Skip to content

Instantly share code, notes, and snippets.

View yvesvanbroekhoven's full-sized avatar

Yves Van Broekhoven yvesvanbroekhoven

View GitHub Profile
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@shmatov
shmatov / .bash_prompt
Last active January 20, 2020 10:49
Bash prompt with rvm, nvm, virtualenv and git integration.
function __git_dirty {
git diff --quiet HEAD &>/dev/null
[ $? == 1 ] && echo " ↺ "
}
function __git_branch {
__git_ps1 "%s"
}
function __my_rvm_ruby_version {
@IanVaughan
IanVaughan / uninstall_gems.sh
Created June 9, 2012 20:37
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@jeffreyiacono
jeffreyiacono / Rakefile
Created February 8, 2012 20:15
rake task for precompiling assets using sprockets within a sinatra app + view helpers
require 'rubygems'
require 'bundler'
Bundler.require
require './application'
namespace :assets do
desc 'compile assets'
task :compile => [:compile_js, :compile_css] do
end
@amolk
amolk / remove-rubber-band-web-apps-ios
Last active May 8, 2024 17:47
Remove rubberband scrolling from web apps on mobile safari (iOS)
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<style>
html, body {margin: 0; padding: 0; overflow: hidden}
<script type="text/javascript">
WebtypeConfig = {
kitId: 'd5d59de3-a6b0-4d6a-b7a2-405bead6519b',
scriptTimeout: 3000
};
(function(){var h=document.getElementsByTagName('html')[0];h.className+=' wt-loading';var t=setTimeout(function(){h.className=h.className.replace(/(\s|^)wt-loading(\s|$)/g,'');h.className+=' wt-inactive';},WebtypeConfig.scriptTimeout);var wt=document.createElement('link');wt.href='//cloud.webtype.com/css/'+WebtypeConfig.kitId+'.css';wt.type='text/css';wt.rel='stylesheet';wt.async='true';wt.onload=wt.onreadystatechange=function(){var rs=this.readyState;if(rs&&rs!='complete'&&rs!='loaded')return;clearTimeout(t);};var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(wt,s);})();
</script>
<script type="text/javascript">
TypekitConfig = {
kitId: 'YOUR_TYPE_KIT_ID',
scriptTimeout: 3000
};
(function(){var h=document.getElementsByTagName('html')[0];h.className+=' wf-loading';var t=setTimeout(function(){h.className=h.className.replace(/(\s|^)wf-loading(\s|$)/g,'');h.className+=' wf-inactive';},TypekitConfig.scriptTimeout);var tk=document.createElement('script');tk.src='//use.typekit.com/'+TypekitConfig.kitId+'.js';tk.type='text/javascript';tk.async='true';tk.onload=tk.onreadystatechange=function(){var rs=this.readyState;if(rs&&rs!='complete'&&rs!='loaded')return;clearTimeout(t);try{Typekit.load(TypekitConfig);}catch(e){}};var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(tk,s);})();
</script>
/* Available css classes:
html.wf-loading = While loading you can hide the fonts to avoid FOUT
@artero
artero / launch_sublime_from_terminal.markdown
Last active September 12, 2024 02:13 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@bobbrez
bobbrez / gist:993344
Created May 26, 2011 15:15
MySQL on OS X using Homebrew

Change Permissions

You'll need to change the permissions for /usr/local for your local user.

sudo chown -R whoami /usr/local

Homebrew

The easiest way to get everything setup is to use Homebrew. To do this, you'll need to first install XCode from the standard XCode from Apple Developer site. Afterwards you can just install Homebrew though its normal installation

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"