I hereby claim:
- I am ajself on github.
- I am ajself (https://keybase.io/ajself) on keybase.
- I have a public key whose fingerprint is 9B46 EB7A D0FA 76D6 BE4F 4C85 82CA 684D 53E7 5E1F
To claim this, I am signing this object:
| has_virtualenv() { | |
| if [ -e .venv ]; then | |
| pybrew venv use `cat .venv` | |
| fi | |
| } | |
| venv_cd () { | |
| cd "$@" && has_virtualenv | |
| } | |
| alias cd="venv_cd" |
| # --DEMO CODE-- | |
| # Mimics the carousel sliding behavior found when clicking text links | |
| # in a Google Drive Document that have comments | |
| # <a href="#" class="screen" data-screen="1">Click!</a> | |
| $(document).on 'click', '.screen', (evt) -> | |
| evt.preventDefault() | |
| console.log evt | |
| screen = $(this).data 'screen' |
| [ | |
| { "keys": ["super+shift+d"], "command": "toggle_side_bar" }, | |
| { "keys": ["super+r"], "command": "refresh_folder_list"}, | |
| { "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }, | |
| // Origami | |
| { "keys": ["super+k", "k"], "command": "travel_to_pane", "args": {"direction": "up"} }, | |
| { "keys": ["super+k", "l"], "command": "travel_to_pane", "args": {"direction": "right"} }, | |
| { "keys": ["super+k", "j"], "command": "travel_to_pane", "args": {"direction": "down"} }, | |
| { "keys": ["super+k", "h"], "command": "travel_to_pane", "args": {"direction": "left"} }, |
| randomHSLAColor = -> | |
| getRandomInRange = (min, max) -> | |
| return Math.floor(Math.random() * (max - min + 1)) + min | |
| "hsla(#{getRandomInRange(0, 360)}, #{getRandomInRange(70, 100)}%, #{getRandomInRange(45, 55)}%, 0.6)" |
| # http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl | |
| httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler) | |
| httpd.socket = ssl.wrap_socket (httpd.socket, certfile='path/to/localhost.pem', server_side=True) | |
| httpd.serve_forever() |
I hereby claim:
To claim this, I am signing this object:
| /* | |
| <javascriptresource> | |
| <name>Save as SVG</name> | |
| <about>Name a layer or layerset with .svg to convert it.</about> | |
| </javascriptresource> | |
| */ | |
| var SvgWiz = SvgWiz || { | |
| settings : { | |
| scriptName : 'svgexport', |
| // I was getting bad results for collectionView.indexPathForItem(at: location) | |
| // Ends up the scroll view content offset needs to be taken into consideration. | |
| func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { | |
| guard let collectionView = collectionView else { return nil } | |
| // The magic sauce | |
| let cellLocation = CGPoint(x: location.x + collectionView.contentOffset.x, | |
| y: location.y + collectionView.contentOffset.y) |
| # Update build number with number of git commits | |
| # adapted from http://blog.curtisherbert.com/automated-build-numbers/ | |
| buildNumber=$(git rev-list HEAD --count) | |
| echo "Updating build number to $buildNumber" | |
| dsym_plist="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist" | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
| if [ -f "$DSYM_INFO_PLIST" ] ; then | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$dsymPlist" | |
| fi |
| /* | |
| This is an update to an example found on http://www.jairobjunior.com/blog/2016/03/05/how-to-rotate-only-one-view-controller-to-landscape-in-ios-slash-swift/ | |
| The code there works, with some updating to the latest Swift, but the pattern isn't very Swifty. The following is what I found to be more helpful. | |
| */ | |
| /* | |
| First, create a protocol that UIViewController's can conform to. | |
| This is in opposition to using `Selector()` and checking for the presence of an empty function. | |
| */ |