Skip to content

Instantly share code, notes, and snippets.

@johan
johan / sandbox-breaker.js
Created August 23, 2010 10:39
Breaks out of the Greasemonkey / Google Chrome user script sandbox and runs the code in the page scope instead, free of sandbox gotchas and deprived of all privileged API:s.
// This block of code injects our source in the content scope and then calls the
// passed callback there. The whole script runs in both GM and page content, but
// since we have no other code that does anything, the Greasemonkey sandbox does
// nothing at all when it has spawned the page script, which gets to use jQuery.
// (jQuery unfortunately degrades much when run in Mozilla's javascript sandbox)
(function(run_me_in_page_scope) {
if ('undefined' == typeof __RUNS_IN_PAGE_SCOPE__) { // unsandbox, please!
var src = arguments.callee.caller.toString(),
script = document.createElement('script');
script.setAttribute("type", "application/javascript");
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@ql-owo-lp
ql-owo-lp / straight.google.user.js
Last active September 3, 2020 18:51
Straight Google
// ==UserScript==
// @name Straight Google
// @id straight_google_pokerface
// @version 1.17.13
// @author Pokerface - Kevin
// @namespace in.co.tossing.toolkit.google
// @description Remove URL redirection from google products
// @license GPL v3 or later version
// @downloadURL https://userscripts.org/scripts/source/121261.user.js
// @updateURL https://userscripts.org/scripts/source/121261.meta.js
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@BrockA
BrockA / waitForKeyElements.js
Created May 7, 2012 04:21
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@joyrexus
joyrexus / README.md
Last active June 19, 2024 09:35 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@vtajzich
vtajzich / build.sh
Last active May 21, 2019 07:45
Install & compile script fro ffmpeg on raspberry pi
#!/bin/bash
function install_build_tools {
sudo apt-get install git
sudo apt-get install libasound2-dev
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install autoconf
sudo apt-get install libtool
@spikedrba
spikedrba / pmd.py
Last active August 13, 2021 17:42
RPi Motion detection with picamera python lib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script was originally created by by killagreg î Thu Dec 18, 2014 7:53 am
# see http://www.raspberrypi.org/forums/viewtopic.php?p=656881#p656881
# This script implements a motion capture surveillance cam for raspberry pi using picam
# and is based on the picamera python library.
# It uses the "motion vectors" magnitude of the h264 hw-encoder to detect motion activity.
@niun
niun / root-ro
Last active June 27, 2024 14:06
Read-only Root-FS with overlayfs for Raspian
#!/bin/sh
#
# Read-only Root-FS for Raspian
#
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with
# overlayfs integrated in Linux Kernel >= 3.18.
#
# Originally written by Axel Heider (Copyright 2012) for Ubuntu 11.10.
# This version can be found here:
# https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash#Overlayfs