This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before running this script, go to Quiver and export all notebooks into json/quiver format | |
# Place them in a folder called `exports` in the same directory as this script. | |
# In terminal, run `ruby quiver-to-evernote.rb` | |
# Check for presence of required gems. | |
# If not present, install the gems | |
["rubygems", "sanitize"].each do |gem| | |
begin | |
gem "#{gem}" | |
rescue Gem::LoadError | |
`gem install #{gem}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstration of server-sent events with Tornado. To see the | |
stream, you can either point your browser to ``http://localhost:8080`` | |
or use ``curl`` like so:: | |
$ curl http://localhost:8080/events | |
""" | |
import signal | |
from tornado import web, gen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put me at server/email.js | |
Meteor.startup(function () { | |
var user = "user"; | |
var password = "password"; | |
var serverAndPort = "smtp.example.com:9999"; | |
var string = 'smtp://' + user + ':' + password + '@' + serverAndPort; | |
process.env.MAIL_URL = string; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## For bash or zsh: | |
# Opens the github page, issue, or new pull request for the current git repository in your browser | |
# Based on https://github.com/jasonneylon/dotfiles/ | |
function gh { | |
giturl=$(git config --get remote.origin.url) | |
if [ "$1" = "help" ]; then | |
echo "gh: Opens this repository's GitHub homepage." | |
echo "gh 123 246: Opens the page for issues or pull requests #123 and #246." | |
echo "gh issues: Opens the repository's issues." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
# connect to database | |
use DBI; | |
my $dbh = DBI->connect("dbi:SQLite:database.db","","") or die "Could not connect"; | |
# shortcut for use in template | |
helper db => sub { $dbh }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun sort-lines-by-length (b e) | |
(interactive "r") | |
(save-excursion | |
(save-restriction | |
(narrow-to-region b e) | |
(let ((items (sort | |
(split-string | |
(buffer-substring (point-min) (point-max)) "[\n]") | |
(lambda(x y) (< (length x) (length y))))) | |
) |