friend_id | friend_name | pet_id | owner_id | pet_type | pet_name |
---|---|---|---|---|---|
1 | John | 1 | 1 | goldfish | Fishy |
2 | Sarah | 1 | 1 | goldfish | Fishy |
3 | Rachel | 1 | 1 | goldfish | Fishy |
4 | Sam | 1 | 1 | goldfish | Fishy |
1 | John | 2 | 1 | goldfish | Nemo |
2 | Sarah | 2 | 1 | goldfish | Nemo |
3 | Rachel | 2 | 1 | goldfish | Nemo |
4 | Sam | 2 | 1 | goldfish | Nemo |
This file contains 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
tell application "Finder" | |
repeat while window 2 exists | |
close window 2 | |
end repeat | |
end tell |
This file contains 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
#!/bin/bash | |
echo -n "%snippet:xxxxtitle%" | tr -d '\n' |
This file contains 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
source "https://rubygems.org" | |
gem 'json' | |
gem 'idonethis' |
This file contains 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
# Assumes `df` is a Pandas DataFrame object | |
import IPython.core.display as di | |
for k, v in df.columns.to_series().groupby(df.dtypes).groups.iteritems(): | |
di.display_html("<ul><li><b>%s</b><ul>%s</ul></li></ul>" % (k, ''.join(["<li>%s</li>" % vv for vv in sorted(v)])), raw=True) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
<a href="javascript:(function()%7Bvar%20x%20%3D%20window.prompt(%22Search%20Amazon.com%20order%20history%20for%3A%22)%3Bwindow.location.href%3D'https%3A%2F%2Fwww.amazon.com%2Fgp%2Fyour-account%2Forder-history%2Fref%3Doh_aui_search%3Fopt%3Dab%26search%3D'%2BencodeURIComponent(x)%7D)()">Drag to your bookmarks bar</a> |
This file contains 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 ruby | |
# Usage: | |
# 1) Save as something.rb on Desktop. Optionally update the date on the line | |
# that beings with "time = " if you want the creation date to be correct in | |
# KeePassX. | |
# 2) Run in Terminal: chmod 777 ~/Desktop/something.rb | |
# 3) Run in Terminal: ~/Desktop/something.rb web_confidential_export.txt | |
# 4) Import the resulting export.xml into KeePassX | |
# 5) Use the "srm" command to delete the plaintext files containing passwords |
This file contains 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 this in your ~/.bash_profile file | |
# To reload the .bash_profile without restarting Terminal, run "source ~/.bash_profile" | |
# http://stackoverflow.com/questions/420456/open-terminal-here-in-mac-os-finder | |
function ff { osascript -e 'tell application "Finder"'\ | |
-e "if (${1-1} <= (count Finder windows)) then"\ | |
-e "get POSIX path of (target of window ${1-1} as alias)"\ | |
-e 'else' -e 'get POSIX path of (desktop as alias)'\ | |
-e 'end if' -e 'end tell'; };\ |
This file contains 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
# | |
# | |
# test.rb | |
# | |
# | |
require 'rubygems' | |
require 'active_record' | |
require 'classifier' | |