Skip to content

Instantly share code, notes, and snippets.

View echohack's full-sized avatar
🎥
twitch.tv/echohack

echohack echohack

🎥
twitch.tv/echohack
View GitHub Profile
@justinredd
justinredd / lean_coffee.md
Last active September 9, 2016 18:25
Lean Coffee

Lean Coffee

  • 60 - 90 minutes
  • 5 - 11 people

Materials

  • Table + chairs
  • PostIts and Pens
  • Timer
@kracekumar
kracekumar / Writing better python code.md
Last active February 19, 2024 03:06
Talk I gave at June bangpypers meetup.

Writing better python code


Swapping variables

Bad code

@postmodern
postmodern / comment.md
Last active January 11, 2024 15:37
Crypto Privacy Copy Pasta
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

#!/bin/zsh
# computer activity data collection for http://jehiah.cz/one-two/
# Originally by Jehiah Czebotar. This verison by Luca Spiller.
FILE="$HOME/Dropbox/activity_log/`hostname`-`date +%Y%m%d`.log"
function log_activity()
{
local TIME=`date "+%Y-%m-%dT%H:%M:%S%z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
@jehiah
jehiah / activity_snapshot.sh
Created January 7, 2013 18:43
A cron job script to capture computer activity every 30 seconds
#!/bin/sh
# computer activity data collection for http://jehiah.cz/one-two/
# by Jehiah Czebotar
FILE="activity_log/`date +%Y%m%d`.log"
function log_activity()
{
local UTC=`date "+%s,%Z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
@jehiah
jehiah / dailyphoto.sh
Last active January 15, 2016 20:08
A script to use isightcapture to take photos via crontab on OSX. crontab: `*/10 * * * * sh bin/take_dailyphoto.sh`
#!/bin/sh
# This script takes a photo if the computer has not been idle for longer than a period of time
# it uses isightcapture from https://www.macupdate.com/app/mac/18598/isightcapture
[ -z "$USER" ] && echo "missing variable \$USER " && exit 1
if [ ! -d /Users/$USER/daily_photo ]; then
mkdir -p $/Users/$USER/daily_photo
fi
IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
export SUDO_ASKPASS=/Users/$USER/bin/get_pass.sh
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb