Skip to content

Instantly share code, notes, and snippets.

@amirnissim
amirnissim / dontforget.bash
Created February 26, 2019 09:43 — forked from ttscoff/dontforget.bash
Quick reminders from Terminal (bash)
#!/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.
#
@amirnissim
amirnissim / downscale.sh
Last active October 22, 2017 11:51 — forked from lanceli/downscale.sh
sips downscale image by percentage in Mac OS X
#!/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
@amirnissim
amirnissim / downscale.sh
Created October 22, 2017 11:49 — forked from lanceli/downscale.sh
sips downscale image by percentage in Mac OS X
#!/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
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()
#!/bin/sh
# pre-commit git hook to make sure developers don't accidentally commit code they didn't mean to commit :)
REMOVEME_STRING="REMOVEME"
ALLOW_COMMITTING_REMOVEME=`git config hooks.allowcommittingremoveme`
# redirect stdout to stderr
exec 1>&2
if [ "$ALLOW_COMMITTING_REMOVEME" != "true" ] &&
@amirnissim
amirnissim / image64.sh
Created July 9, 2013 09:47 — forked from puppybits/image64.sh
convert an image to base64 string #util
#!/bin/sh
# Examples:
# ./image64.sh myImage.png
# outputs: data:image/png;base64,xxxxx
# ./image64.sh myImage.png -img
# outputs: <img src="data:image/png;base64,xxxxx">
filename=$(basename $1)
xtype=${filename##*.}
append=""
@amirnissim
amirnissim / gist:5639453
Created May 23, 2013 21:11 — forked from ranbena/gist:5263279
Blank 1px transparent gif in Base64
data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==