Skip to content

Instantly share code, notes, and snippets.

View cworsley4's full-sized avatar
👷‍♂️
Wreckingball

Cecil Worsley cworsley4

👷‍♂️
Wreckingball
View GitHub Profile
@thibautsacreste
thibautsacreste / rack_show_session.rb
Last active March 12, 2021 13:43
Ruby: decode rack session cookie
require 'base64'
require 'cgi'
def show_session(cookie)
Marshal.load(Base64.decode64(CGI.unescape(cookie.split("\n").join).split('--').first))
end
@gregberge
gregberge / cluster.js
Created March 9, 2014 10:32
Primus cluster
var cluster = require('cluster');
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < 20; i++) {
cluster.fork();
}
return ;
@belbomemo
belbomemo / gist:b5e7dad10fa567a5fe8a
Created July 1, 2014 07:36
Go Gopher ASCII Art
,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,
/ __/ /' ^. / \ ^@q f
[ @f | @)) | | @)) l 0 _/
\`/ \~____ / __ \_____/ \
| _l__l_ I
} [______] I
] | | | |
] ~ ~ |
| |
@james-huston
james-huston / message.sh
Last active August 29, 2015 14:14
Generate an image with text in it to look like an sms using ImageMagick
#!/bin/bash
cat test.txt | \
convert -background '#44aff7' -fill white -size 250x5000 -trim +repage -font AvantGarde-Book -pointsize 16 caption:@- miff:- |\
#convert -background blue \
# -size $((`identify -format %w test_tmp.png` + 20))x$((`identify -format %h test_tmp.png` + 20)) \
# xc: test_tmp.png -flatten test.png
convert - -bordercolor '#44aff7' -border 10x10 test.png
@seanmckaybeck
seanmckaybeck / remote_servo.ino
Last active June 7, 2018 07:45
Remote control servo with Particle Photon. Apache License, copyright 2015 Sean Beck
Servo serv;
int pos = 0;
void setup() {
serv.attach(D0);
Spark.function("setpos", setPos);
Spark.variable("getpos", &pos, INT);
}
void loop() {
anonymous
anonymous / palindrom_dm.js
Created May 31, 2016 13:55
'use strict'; // avoid ambiguity and sloppy errors
/**
* Tests whether or not a given string is a Palindrome
* @param {string} stringToTest - the string to test.
*/
function isPalindrome(stringToTest) {
var start = 0,
end;
@nikhita
nikhita / update-golang.md
Last active July 3, 2024 13:01
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: