Skip to content

Instantly share code, notes, and snippets.

View radermacher's full-sized avatar

Richard Radermacher radermacher

View GitHub Profile
@radermacher
radermacher / .htaccess
Last active December 23, 2015 00:09 — forked from basbl/.htaccess
block users except facebook bot
AuthName "Realm"
AuthUserFile /path/to/.htpasswd
AuthType Basic
Satisfy Any
<Limit GET POST>
Order Deny,Allow
Deny from all
#https://developers.facebook.com/docs/ApplicationSecurity/#facebook_scraper
#-> whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
@radermacher
radermacher / README.md
Last active December 25, 2015 11:59 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
<meta property="og:title" content="Page Title" />
<meta property="og:description" content="..." />
<meta property="og:image" content="http://absolute.url/path/to/image.png?width=600&height=315" />
<meta property="og:image:secure_url" content="https://absolute.url/path/to/image.png?width=600&height=315" />
@radermacher
radermacher / buzz5.js
Created January 15, 2014 01:02 — forked from 19h/buzz5.js
var hash = function (seed) {
seed = seed || 123456789;
var r = function (m_w) {
var m_w = m_w || 123456789;
var m_z = 987654321;
var mask = 0xffffffff;
return function () {
m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;
.logo {
margin-left: 0px;
}
.logo,
.sender_address {
margin-top: -15px;
}
.document_recipient {

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@radermacher
radermacher / install-composer.sh
Last active August 29, 2015 13:57
Add support for composer to ManagedHosting Pro @domainfactory
# Run
# curl -sS https://gist.githubusercontent.com/deseloper/9490727/raw/961ed008c8e784fc62a929ae84eed275d25d65f2/install-composer.sh | sh
#
PHPCLI=/usr/local/bin/php5.4.16-cli
cd ~; mkdir bin
curl -sS https://getcomposer.org/installer | ${PHPCLI} -- --install-dir=bin
chmod +x bin/composer.phar
echo "alias composer=\"${PHPCLI} ~/bin/composer.phar\"" >> ~/.bashrc
echo "alias composer=\"${PHPCLI} ~/bin/composer.phar\"" >> ~/.zshrc
<html>
<head>
<title>Web RTC</title>
<style type="text/css">
video {
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
}
video {
width: 100%;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Facebook Card" />
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="http://rawgit.com/briangonzalez/jquery.adaptive-backgrounds.js/master/dist/jquery.adaptive-backgrounds.min.js"></script>
<style id="jsbin-css">