Skip to content

Instantly share code, notes, and snippets.

View sj26's full-sized avatar
🤹‍♂️

Samuel Cochran sj26

🤹‍♂️
View GitHub Profile
@sj26
sj26 / .gitignore
Last active November 12, 2020 01:30 — forked from guilherme-teodoro/style.css
Basecamp 3 - Dark mode
*.css
!*.user.css
/node_modules
@sj26
sj26 / sidekiq.service
Last active May 3, 2024 07:07 — forked from dsadaka/\lib\systemd\system\sidekiq-static.service
systemd unit files for multiple sidekiq workers
[Unit]
Description=Sidekiq workers
# start as many workers as you want here
Wants[email protected]
Wants[email protected]
# ...
[Service]
Type=oneshot
ExecStart=/bin/true
@sj26
sj26 / papertrail-to-s3.rb
Last active August 24, 2018 23:07 — forked from mujtaba3B/dl_papertrail_archives
Backup old papertrail archive to s3
require "active_support/all"
require "aws-sdk"
require "concurrent"
papertrail_token = "..."
s3 = Aws::S3::Client.new(region: "us-east-1")
s3_bucket = "..."
s3_prefix = "papertrail/logs/[account-id]"
@sj26
sj26 / noise.js.coffee
Last active December 20, 2015 14:19 — forked from banksean/perlin-noise-classical.js
CoffeeScript version of simplex noise and a simple RNG useful for seeding.
# Ported from Stefan Gustavson's java implementation
# http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
# Read Stefan's excellent paper for details on how this code works.
#
# Sean McCullough [email protected]
{floor, sqrt} = Math
class @Noise
grad3: [
@sj26
sj26 / prance.sh
Last active December 18, 2015 15:09 — forked from anonymous/gist:508218
echo "\e[1m\e[34m ,%%%, \e[0m"
echo "\e[1m\e[34m ,%%%` %==-- \e[0m"
echo "\e[1m\e[34m ,%%`( '| \e[0m"
echo "\e[1m\e[34m ,%%@ /\_/ \e[0m"
echo "\e[1m\e[34m ,%.-\"\"\"--%%% \"@@__ \e[0m"
echo "\e[1m\e[34m %%/ |__`\ \e[0m"
echo "\e[1m\e[34m .%'\ | \ / // \e[0m"
echo "\e[1m\e[34m ,%' > .'----\ | [/ \e[0m"
echo "\e[1m\e[34m < <<` || \e[0m"
echo "\e[1m\e[34m `\\\ || \e[0m"
@sj26
sj26 / gist:5201293
Last active December 15, 2015 04:28 — forked from geelen/gist:5201278
my.angular.directives.directive "mydirective",
Array "$http", "$lolwhut", ($http, $lolwhut) ->
scope:
here: "i"
bind: "=some"
things: "&away"
link: (scope, el, attrs) ->
"WOW I'M DIRECTING"
@sj26
sj26 / easy_way.rb
Last active December 10, 2015 20:48 — forked from mislav/easy_way.rb
require 'net/http'
def resolve url
begin
raise "too many redirects" if (count ||= 0; count += 1) > 5
uri = URI(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.is_a? URI::HTTPS
http.open_timeout = 1.5
http.read_timeout = 2
@sj26
sj26 / 0-readme.md
Created May 5, 2012 05:39 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@sj26
sj26 / application.html.slim
Created April 11, 2012 12:47 — forked from rwz/application.html.slim
nestive layouts
= extends :html5_base do
- append :head do
meta(http-equiv="X-UA-Compatible" content="IE=edge")
title Lolwut
= area :assets do
= javascript_include_tag 'application'
= yield
#fb-root
FFW =
g: (i) -> document.getElementById(i)
gv: (i) -> @g(i).value
sv: (i, v) -> @g(i).value = v
a: (i, c=document) -> c.getElementsByTagName(i)
ss: (i, v, n) -> @g(i).style[v] = n
misc: {}
effect: {}
event: {}
browser: {}