Skip to content

Instantly share code, notes, and snippets.

@perky
perky / ProFi.lua
Created May 30, 2012 20:32
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
@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:

@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@duzun
duzun / enableSelect-bookmarklet.html
Last active December 22, 2023 08:04
Enable Right Click and Text Selection Bookmarklet
<a class="btn btn-default btn-info bookmarklet" href="javascript:(function(d){var a=d.document,h=function(){},c=a.body||a.getElementsByTagName("body")[0],f=a.documentElement||a.getElementsByTagName("html")[0],k=[c,f,a],l=["webkit","khtml","moz","ms",""],g=["contextmenu","selectstart","select","mousedown","mouseup"],b=d.Selection,e=b&&b.prototype;e&&(e.removeAllRanges=h,b=a.selection)&&(b.clear=h);for(e=k.length;e--;)if(f=k[e]){for(b=g.length;b--;)f["on"+g[b]]=null;if(a=f.style)for(a.cursor="",a.webkitTouchCallout="initial",b=l.length;b--;)a[((c=l[b])?"-"+c+"-":c)+"user-select"]="initial"}(c=d.jQuery||d.Zepto)&&c(d).off(g)})(this);">
Enable Select
</a>
@nightroman
nightroman / FarGit.psm1
Last active March 21, 2021 15:20
Interactive Git commands for Far Manager + FarNet.PowerShellFar
# Moved to https://github.com/nightroman/FarGit
// ==UserScript==
// @id iitc-plugin-highlight-portals-supply-base@fl0o0l
// @name IITC plugin: highlight portals supply base
// @category Highlighter
// @version 0.0.1.20160106.000001
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL https://gist.github.com/DrMacinyasha/c6207fead937be8f5d3a/raw/portal-highlighter-supply-base-rmciimod.user.js
// @downloadURL https://gist.github.com/DrMacinyasha/c6207fead937be8f5d3a/raw/portal-highlighter-supply-base-rmciimod.user.js
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
@c-kick
c-kick / hnl.mobileConsole.js
Last active January 14, 2024 18:24
NOTE: V2 Released! Seehttps://github.com/c-kick/mobileConsole hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
*
* NEW VERSION AT https://github.com/c-kick/mobileConsole
*
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
@a-susloff
a-susloff / IITC plugin- Bookmarks for maps and portals (polyline version).user.js
Created November 9, 2016 20:24
IITC plugin- Bookmarks for maps and portals (polyline version)
// ==UserScript==
// @id iitc-plugin-bookmarks@Sunny0s
// @name IITC plugin: Bookmarks for maps and portals (polyline version)
// @category Controls
// @version 0.1
// @namespace
// @updateURL
// @downloadURL
// @description based on zaso Bookmarks plugin, the only difference if auto draw drawing polylines, not polygons
// @include https://*.ingress.com/intel*
// ==UserScript==
// @id iitc-plugin-bookmarks@Sunny0s
// @name IITC plugin: Bookmarks for maps and portals (sunny0s version)
// @category Controls
// @version 0.2
// @namespace
// @updateURL
// @downloadURL
// @description based on zaso Bookmarks plugin, differences: auto draw drawing polylines, not polygons; DT to BMs function
// @include https://*.ingress.com/intel*
@Shujito
Shujito / spotihosts
Last active November 29, 2023 06:56
The hosts file entries to block Spotify audio ad servers.
# taken from here:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
0.0.0.0 adclick.g.doublecklick.net
0.0.0.0 adeventtracker.spotify.com
0.0.0.0 ads-fa.spotify.com
0.0.0.0 analytics.spotify.com
0.0.0.0 audio2.spotify.com
0.0.0.0 b.scorecardresearch.com
0.0.0.0 bounceexchange.com
0.0.0.0 bs.serving-sys.com