Skip to content

Instantly share code, notes, and snippets.

🍭
I am a meat popsicle

Sean Handley seanhandley

🍭
I am a meat popsicle
Block or report user

Report or block seanhandley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e64c9dbaa0d52c7d04635fc94250e873
SESSION=`curl -s -L -I http://raspberrypi:9091/transmission/web | grep X-Transmission-Session-Id | cut -d' ' -f 2 | sed 's/[[:space:]]*$//'`
curl 'http://raspberrypi:9091/transmission/rpc' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,fr;q=0.8,ru;q=0.7' -H "X-Transmission-Session-Id: `echo $SESSION`" -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Content-Type: json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: http://raspberrypi:9091/transmission/web/' -H 'DNT: 1' --data-binary '{"method":"torrent-add","arguments":{"paused":false,"download-dir":"/mnt/sda1/New","filename":"'"${URL}"'"}}' --compressed --insecure
@seanhandley
seanhandley / pi_info.sh
Last active Jul 16, 2019
Display Info About Raspberry Pi
View pi_info.sh
# Cheers to the original author https://www.raspberrypi.org/forums/viewtopic.php?t=23440
function pi_info_uptime() {
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
printf "%d days, %d hours, %d minutes, %d seconds" "$days" "$hours" "$mins" "$secs"
}
View gist:d76c51099a32287c0a9074d5f15ac7d0
0.0.0.0 r4.sn-cxaaj5o5q5-tt16.googlevideo.com
0.0.0.0 r3.sn-q5u5bgv02-3c26.googlevideo.com
0.0.0.0 r12.sn-bvvbax-hn26.googlevideo.com
0.0.0.0 r7.sn-w5nuxa-o536.googlevideo.com
0.0.0.0 r1.sn-4g5e6n76.googlevideo.com
0.0.0.0 r3.sn-4g5e6n76.googlevideo.com
0.0.0.0 r4.sn-4g5e6n76.googlevideo.com
0.0.0.0 r5.sn-4g5e6n76.googlevideo.com
0.0.0.0 r6.sn-4g5e6n76.googlevideo.com
0.0.0.0 r1.sn-nx5e6n76.googlevideo.com
View data.rb
module H3
class Resolution
extend FFI::DataConverter
native_type FFI::Type::INT
RES_RANGE = 0..15
class << self
def to_native(value, _context)
failure unless value.is_a?(Integer) && RES_RANGE.cover?(value)
View typedef.rb
typedef :ulong_long, :h3_index
View smoky_red_pepper_chicken.md

Smoky Red Pepper Chicken

Feeds 4.

Goes beautifully with green beans and rice or new potatoes.

Ingredients

  • 3 x Chicken breast fillets
  • 200ml Double cream
@seanhandley
seanhandley / docker-compose.yml
Last active Oct 12, 2019
How To Set Up Docker For Mac (Mojave) with Native NFS
View docker-compose.yml
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@seanhandley
seanhandley / lb.rb
Created Aug 26, 2017
Build a load balancer with Fog
View lb.rb
require 'fog/openstack'
conn = {
openstack_auth_url: ENV["OS_AUTH_URL"],
openstack_username: ENV["OS_USERNAME"],
openstack_api_key: ENV["OS_PASSWORD"],
openstack_project_name: ENV["OS_PROJECT_NAME"],
openstack_domain_id: ENV["OS_USER_DOMAIN_NAME"]
}
@seanhandley
seanhandley / fizzbuzz.ex
Last active Sep 20, 2017
FizzBuzz in Elixir / The Magic of Functional Pattern Matching
View fizzbuzz.ex
fb = fn
0, 0, _ -> "FizzBuzz"
0, _, _ -> "Fizz"
_, 0, _ -> "Buzz"
_, _, x -> x
end
fizzbuzz = fn (n) -> fb.(rem(n, 3), rem(n, 5), n) end
fizzbuzz.(10) # => "Buzz"
View custom_attributes.rb
module CustomAttributes
def attributes(*attrs)
attrs.each do |sym|
define_method sym do
instance_variable_get("@#{sym}")
end
define_method :"#{sym}=" do |v|
instance_variable_set("@#{sym}", v)
end
end
You can’t perform that action at this time.