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
#!/bin/bash | |
# dontforget | |
# | |
# A stupid script for short term reminders in bash | |
# | |
# Arguments just need to contain a number and a bunch of words. | |
# | |
# The number can be anywhere in the arguments, but there shouldn't | |
# be any other numeric digits. | |
# |
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
#!/bin/bash | |
if [ $1 ] | |
then | |
echo Processing file $1; | |
else | |
# macOS find syntax | |
for file in `find . -type f -name *.png`; do | |
echo Processing file "$file"; | |
sips -Z $(($(sips -g pixelWidth "$file" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$file" --out "$file" &> /dev/null |
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
#!/bin/bash | |
if [ $1 ] | |
then | |
echo Processing file $1; | |
else | |
for var in `find *.png`; | |
do | |
echo Processing file $var; | |
sips -Z $(($(sips -g pixelWidth "$var" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$var" --out "resized_$var" &> /dev/null |
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
class MyExtension < Middleman::Extension | |
def initialize(app, options_hash={}, &block) | |
puts "MyExtension: init" | |
super | |
end | |
def after_configuration | |
puts "MyExtension: after_configuration" | |
end |
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
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
class Handler(tornado.web.RequestHandler): | |
def error(self): | |
self.set_header("Access-Control-Allow-Credentials", "true") | |
self.set_header("Access-Control-Allow-Origin", "") | |
self.set_header("Access-Control-Allow-Methods", "GET, POST") |
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
class Foo(): | |
def __init__(self, name): | |
self.name = name | |
def get_name(self): | |
return self.name | |
x = Foo('x') | |
y = Foo('y') |
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
cd my-repo | |
git fetch upstream | |
git checkout --detach upstream/master | |
git pull --no-commit upstream refs/pull/<pr-id>/head | |
# local repo now has (uncommited) changes from pull request |
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 next in `cat $1` | |
do | |
say "$next" | |
read | |
done | |
exit 0 |
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
# this file documents the process I used to migrate the project from | |
# mercurial (bitbucket) to git (github) | |
# | |
# we are going to need | |
# - fast export: https://github.com/frej/fast-export | |
# - bfg: http://rtyley.github.io/bfg-repo-cleaner/ | |
alias bfg="java -jar bfg.jar" | |
# clone single revision of the hg repo to eliminate unwanted heads |
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
from marionette import Marionette | |
m = Marionette() | |
m.start_session() | |
from gaiatest.apps.homescreen.app import Homescreen | |
hs = Homescreen(m) | |
from gaiatest import GaiaDevice | |
gd = GaiaDevice(m) | |
gd.unlock() | |
hs.launch() | |
hs.open_context_menu() |
NewerOlder