Skip to content

Instantly share code, notes, and snippets.

View contentfree's full-sized avatar

Dave Myron contentfree

View GitHub Profile
@davidwkeith
davidwkeith / index.html
Last active April 10, 2024 12:01
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom protocol handlers. Licensed under the WFTPL http://www.wtfpl.net/txt/copying/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!--
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.
@shawndumas
shawndumas / soundex.js
Last active February 21, 2024 11:47
Soundex in JavaScript
var soundex = function (s) {
var a = s.toLowerCase().split(''),
f = a.shift(),
r = '',
codes = {
a: '', e: '', i: '', o: '', u: '',
b: 1, f: 1, p: 1, v: 1,
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2,
d: 3, t: 3,
l: 4,
@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@cinsk
cinsk / check-nfs.sh
Last active January 20, 2023 22:27
Check if NFS mounted directory is stale
#!/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
check-nfs () {
local TMPFILE=/tmp/checknfs.$$ RET=0 ORPHAN SUBSHELLPID
if [ "$#" -eq 0 ]; then
cat<<EOF
usage: check-nfs NFS-DIRECTORY...
@reggi
reggi / glob-up-and-running.md
Last active March 16, 2022 16:47
A tutorial on how to get started using glob patterns in your terminal. #writing

Glob Up and Running

To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.

If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.

echo **/*.js
@TotalLag
TotalLag / EdgeMax advanced-queue QoS
Last active August 5, 2020 03:57
An upgrade from traffic-policy shaper
set traffic-control advanced-queue root queue 1 bandwidth 50mbit
set traffic-control advanced-queue root queue 1 attach-to global
set traffic-control advanced-queue queue-type sfq SFQ_DOWN
set traffic-control advanced-queue queue-type fq-codel FQCODEL_UP ecn disable
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN target 5ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN quantum 1514
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN limit 1001
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN interval 50ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN flows 1024
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN ecn enable
@sansmischevia
sansmischevia / Graphite on Amazon Linux
Last active August 10, 2017 12:01 — forked from outmost/Graphite on Amazon Linux
Sets up graphite, carbon, whisper, and statsd on ami-3275ee5b
# AMI: ami-3275ee5b
# Login: ec2-user
# Apply updates
sudo yum update
# Enable Epel Repo
sudo vim /etc/yum.repos.d/epel.repo.
# Under the section marked [epel], change enabled=0 to enabled=1.
@fujin
fujin / 8_vol_ebs_stripeset.rb
Created November 24, 2010 21:48
automatic 8 vol ebs LVM2 stripe set (raid0). 256k chunks, 8-way stripe. 65k readahead.
include_recipe "aws"
include_recipe "lvm"
include_recipe "xfs"
esvg = node.elasticsearch.ebs.lvm.volume_group
eslv = node.elasticsearch.ebs.lvm.logical_volume
Chef::Log.info "ElasticSearch: setting up 8 100G EBS volumes"
aws = data_bag_item("aws", node.app_environment)
8.times do |d|
disk = (d == 0 ? "/dev/sdi" : "/dev/sdi#{d}")
@contentfree
contentfree / gist:1837753
Created February 15, 2012 17:52 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3