Skip to content

Instantly share code, notes, and snippets.

Dave Myron contentfree

  • Seattle, WA
Block or report user

Report or block contentfree

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
@reggi
reggi / glob-up-and-running.md
Last active Oct 4, 2019
A tutorial on how to get started using glob patterns in your terminal. #writing
View glob-up-and-running.md

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
@cinsk
cinsk / check-nfs.sh
Last active Jul 8, 2019
Check if NFS mounted directory is stale
View check-nfs.sh
#!/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...
@sansmischevia
sansmischevia / Graphite on Amazon Linux
Last active Aug 10, 2017 — forked from tomsutton1984/Graphite on Amazon Linux
Sets up graphite, carbon, whisper, and statsd on ami-3275ee5b
View Graphite on Amazon Linux
# 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.
@davidwkeith
davidwkeith / index.html
Last active Oct 24, 2019
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/
View index.html
<!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.
@contentfree
contentfree / gist:1837753
Created Feb 15, 2012 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
View gist:1837753
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
@shawndumas
shawndumas / soundex.js
Last active Oct 21, 2019
Soundex in JavaScript
View soundex.js
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
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form
View rails31init.md

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

@fujin
fujin / 8_vol_ebs_stripeset.rb
Created Nov 24, 2010
automatic 8 vol ebs LVM2 stripe set (raid0). 256k chunks, 8-way stripe. 65k readahead.
View 8_vol_ebs_stripeset.rb
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}")
You can’t perform that action at this time.