Skip to content

Instantly share code, notes, and snippets.

View shospodarets's full-sized avatar

Serg Hospodarets shospodarets

View GitHub Profile
@getify
getify / gist:2926699
Created June 13, 2012 21:50
non-rectangular (line and circle) clears in canvas
/*
To see a demo of these in use, check out: http://test.getify.com/test-canvas-clear-alt.html
Example uses:
*/
clearCircle(context,/*x=*/120,/*y=*/80,/*radius=*/60);
clearLineSquared(context,/*x1=*/10,/*y1=*/10,/*x2=*/53,/*y2=*/67,/*thickness=*/5);
clearLineRounded(context,/*x1=*/15,/*y1=*/100,/*x2=*/90,/*y2=*/170,/*thickness=*/10);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bennylope
bennylope / gist:1894706
Created February 23, 2012 19:50
Canonical URLs with Jekyll
<link rel="canonical" href="http://yourdomain.com{{ page.url | replace:'index.html','' }}" />
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@artero
artero / launch_sublime_from_terminal.markdown
Last active May 15, 2024 03:38 — 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

@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete