Skip to content

Instantly share code, notes, and snippets.

View robertkowalski's full-sized avatar

Robert Kowalski robertkowalski

View GitHub Profile
@sindresorhus
sindresorhus / blur-prank.user.js
Last active January 4, 2023 10:33
Blur prank UserScript
// ==UserScript==
// @name Dictionary
// @version 0.1
// @author Sindre Sorhus
// @include *
// ==/UserScript==
document.documentElement.style.webkitFilter='blur(0.5px)';
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@sindresorhus
sindresorhus / markdown-preview-mou.md
Created June 5, 2012 07:34
How to write your Markdown in Sublime Text 2 and preview in Mou

How to write your Markdown in Sublime Text 2 and preview in Mou

I use Sublime for everything text related, but it doesn't have any built-in way to preview my Markdown files.

This is how easy it is to preview in Mou:

  • In Sublime, go to Tools -> Build System -> New Build System...
  • In the newly opened file, replace the file contents with this and save: { "osx": {
@lukas-vlcek
lukas-vlcek / gist:1075067
Created July 10, 2011 22:55
Test of attachments plugin
#!/bin/sh
host=localhost:9200
curl -X DELETE "${host}/test"
curl -X PUT "${host}/test" -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
@alexgibson
alexgibson / Touch-Event-Delegation.js
Created July 6, 2011 19:38
Event delegation for JavaScript 'tap' events
var tapArea, moved, startX, startY;
tapArea = document.querySelector('#list'); //the element to delegate
moved = false; //flags if the finger has moved
startX = 0; //starting x coordinate
startY = 0; //starting y coordinate
//touchstart
tapArea.ontouchstart = function(e) {