Skip to content

Instantly share code, notes, and snippets.

@gijsk
gijsk / jquery.singlelineeditor.js
Created August 22, 2011 08:19
Single line editor jQuery plugin
(function($) {
function getRangeBounds(r) {
function isCDN(n) {
var t = n.nodeType;
return t == 3 || t == 4 || t == 8;
}
function getNodeIndex(node) {
var i = 0;
@Stanback
Stanback / nginx.conf
Last active July 24, 2024 18:44 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@cletusw
cletusw / get-old-chromium-binary.md
Last active December 7, 2020 18:32
Download an old Chromium binary

(source)

Taking [denilson-sá's answer][2] further...

You need revision numbers to grab downloads. So first lookup the full version string from the following URL, adjusting parameters as needed:

https://omahaproxy.appspot.com/history.json?channel=stable&os=mac

For Chrome version 28 the full version string is 28.0.1500.71. Now go to https://omahaproxy.appspot.com and enter the full version string ("28.0.1500.71") into the Position Lookup box. Copy the Base Position number ("209842" in this case).

#!/usr/bin/env python
# cycle-workspace
# Moves the currently active workspace to the next active display
# Depends on i3-py (`pip install i3-py`)
import i3
# figure out what is on, and what is currently on your screen.
focused_workspace = list(filter(lambda s: s['focused'], i3.get_workspaces()))[0]
@jkohlin
jkohlin / index.html
Created June 28, 2017 10:58
Frequency and amplitude visualiser using web audio API
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Web audio API</title>
<style>
</style>
</head>
<body>
<button id="play-btn" style="display:none;">play/pause</button>
@sonOfRa
sonOfRa / mergetoolwrapper.sh
Last active August 29, 2022 09:57
Use Sublime Merge as a git mergetool
#!/bin/bash
# A wrapper script to make sublime_merge work more nicely
# when used as a git-mergetool
WORKDIR=`git rev-parse --show-toplevel`
REAL_HOME="$HOME/"
# Replace a leading homedir with ~/ to match the window title
REAL_WORKDIR=${WORKDIR/"^$REAL_HOME"/"~/"}
sublime_merge $REAL_WORKDIR
@GreepTheSheep
GreepTheSheep / _TM_Collisions_tutorial.md
Last active April 7, 2023 16:38
Collisions on a TM dedicated server

Create a file on UserData/Scripts/Modes/Trackmania/collisions.Script.txt , with the content on file linked with this gist

Then you need to edit your matchsettings file like this :

<playlist>
    <gameinfos>
        <script_name>Trackmania/collisions.Script.txt</script_name>
    </gameinfos>