Skip to content

Instantly share code, notes, and snippets.

@jcsrb
jcsrb / settings.js
Last active December 14, 2015 18:19
RubyTest Sublime Text settings for RVM with Bundler https://github.com/maltize/sublime-text-2-ruby-tests
/*
in case you get errors like this
ruby:1: Invalid char `\x7F' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1: Invalid char `\x01' in expression
ruby:1:in `<main>': uninitialized constant ELF (NameError)
@jcsrb
jcsrb / test_for_audio.js
Last active December 14, 2015 13:08
which is preferred?
var hasNativeAudio = !!window.Audio; // cast to Boolean?, this is how Modernizr checks
// or
var hasNativeAudio = typeof window.Audio != 'undefined'; // check if defined
// or
var hasNativeAudio = 'Audio' in window; // check if in scope
@jcsrb
jcsrb / command.sh
Last active June 21, 2020 19:56
if you get "socket() failed (24: Too many open files) while connecting to upstream" on nginx on MacOS
echo 'kern.maxfiles=20480' | sudo tee -a /etc/sysctl.conf
echo -e 'limit maxfiles 8192 20480\nlimit maxproc 1000 2000' | sudo tee -a /etc/launchd.conf
echo 'ulimit -n 4096' | sudo tee -a /etc/profile
@jcsrb
jcsrb / gist:4558780
Created January 17, 2013 19:21
fallback for core count
CPUCORECOUNT=$(cat /proc/cpuinfo | grep vendor_id | wc -l) && echo $(( CPUCORECOUNT == 0 ? 1 : CPUCORECOUNT ))
@jcsrb
jcsrb / dabblet.css
Created November 19, 2012 08:36
Untitled
@media print
{
html:after{
content:"Why would you print this?";
font-size: 5em;
position: absolute;
width: 100%;
text-align: center;
}
@jcsrb
jcsrb / dabblet.css
Created August 13, 2012 10:13 — forked from LeaVerou/dabblet.css
Move in a circle without wrapper elements
/**
* Move in a circle without wrapper elements
* Idea by Aryeh Gregor, simplified by Lea Verou
*/
@keyframes rot {
from {
transform: rotate(0deg)
translate(-150px)
rotate(0deg);
@jcsrb
jcsrb / dabblet.css
Created July 30, 2012 16:02
Untitled
body{ display:block; }body:after{content:'';font-size: 1em;color: black;}
@media only screen and (min-device-width: 1cm){ body:after{content: 'min-device-width: 1cm'}}
@media only screen and (min-device-width: 2cm){ body:after{content: 'min-device-width: 2cm'}}
@media only screen and (min-device-width: 3cm){ body:after{content: 'min-device-width: 3cm'}}
@media only screen and (min-device-width: 4cm){ body:after{content: 'min-device-width: 4cm'}}
@media only screen and (min-device-width: 5cm){ body:after{content: 'min-device-width: 5cm'}}
@media only screen and (min-device-width: 6cm){ body:after{content: 'min-device-width: 6cm'}}
@media only screen and (min-device-width: 7cm){ body:after{content: 'min-device-width: 7cm'}}
@jcsrb
jcsrb / dabblet.css
Created June 26, 2012 21:34
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div{
margin: 100px auto;
@jcsrb
jcsrb / dabblet.css
Created June 26, 2012 21:00
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div{
margin: 100px auto;
height: 300px;
width: 300px;
@jcsrb
jcsrb / dabblet.css
Created June 26, 2012 20:39
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div{
margin: 100px auto;
height: 300px;
width: 400px;
background: red;
padding: 5px;