Skip to content

Instantly share code, notes, and snippets.

View steven2358's full-sized avatar

Steven Van Vaerenbergh steven2358

View GitHub Profile
@masdeseiscaracteres
masdeseiscaracteres / toUFT8.sh
Last active August 29, 2015 14:03
Automatically detect the encoding of a file an convert it to UTF-8 (use with care)
#!/bin/bash
if [[ "$#" -ne 1 ]]; then
echo "Usage: ./toUTF8 <dir>"
exit 1
fi
OUTPUT_ENC=UTF-8
FOLDER=$1
ICONV="iconv"
# Convert
find $1 -type f -name "*" | while read fn; do
anonymous
anonymous / btc_hue.markdown
Created December 2, 2013 05:39
BTC Philip's Hue Over/Under Colors

#BTC Ticker Light This script updates one of your Philip's Hue lights to be either red or green depending on if the current price of bitcoin is below or above the 24 hour weighted price.

The light

##Install Dependencies
easy_install install beautifulhue

##The Script
Save this to a python file after customizing your Philip's Hue Bridge ip, username, and light_id.

@steven2358
steven2358 / cheatsheet.matlab
Last active March 21, 2022 02:37
Matlab Cheat sheet
% Matlab cheat sheet
% Author: Steven Van Vaerenbergh
% Last version: https://gist.github.com/steven2358/7578242
%% SYSTEM
% seed a random generator
seed = 1;
rng('default');
// create the audio context (chrome only for now)
var context = new webkitAudioContext();
var audioBuffer;
var sourceNode;
var analyser;
var javascriptNode;
// get the context from the canvas to draw on
var ctx = $("#canvas").get()[0].getContext("2d");
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@Xeroday
Xeroday / clickjack.html
Last active December 17, 2015 04:38
Hovering over the link shows one URL, but clicking on it sends you to another.
<script>
function showLink() {
document.getElementById("theLink").setAttribute("href","http://www.google.com"); //URL to show
}
function clickJack() {
document.getElementById("theLink").setAttribute("href","http://www.bing.com"); //URL that it actually goes to
}
</script>
<a id="theLink" href="#" onmouseover="showLink()" onmousedown="clickJack()">Click me</a>
@nickleefly
nickleefly / register.py
Last active November 14, 2021 07:29
When you install python for all user, this problem will occurs, if you select install python for current, there is no issue. Save this file in your D disk for example, go to cmd run 'python register.py', then you will be able to install easy_install then go to C:\Python27\Scripts run easy_install.exe -U bottle
#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
@Angles
Angles / some iOS browser URI launching JS snippets.js
Last active October 8, 2023 18:57
"Open In" Bookmarklets for iOS
/* WITH MODS TO ORIG -- iOS Browser Bookmarklets to launch other apps and stuff */
/* ver 2014-04-14a */
/* backing up my "Open In" bookmarks */
// note iOS6 requires some changes to these
// BEGIN TESTING STUFF -- IN PROFRESS LIKELY NOT WORKING
// SOME WORK, MOST tests are not WORK --
// PINNER APP TEST STUFF (as a private one)
// the page title as the title and your selected text as the description.
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>