Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Dayjob

Mark Sta Ana booyaa

🏠
Dayjob
View GitHub Profile
@littlemove
littlemove / gist:3040473
Created July 3, 2012 15:28
Drag-n-Drop dataTransfer manipulation
$('<image selector>').bind('dragstart', function(e) {
var old_src = e.originalEvent.dataTransfer.getData('text/html');
var new_src = old_src.replace('str_to_replace','str_replacement');
e.originalEvent.dataTransfer.setData('text/html', new_src);
});
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jippi
jippi / gist:1939271
Created February 29, 2012 08:52
Linode => Hetzner migration
export install, partition, sync, clean boot, install image, edit , reboot
ssh [email protected] "dd if=/dev/xvdc " | dd of=/dev/sda1
find /etc -type f -exec sed -i s/178.79.138.75/176.9.207.38/g {} \;
Migration steps:
Linode Disk Partition: /dev/xvdb
Hetzner Disk Partition: /dev/sda
@oinume
oinume / config.py
Created September 10, 2011 15:59
Flask + python-oauth2 + python-twitter sample
# app/config.py
# -*- coding: utf-8 -*-
import os
class Config(object):
DEBUG = False
SQLALCHEMY_ECHO = False
SECRET_KEY = 'dev_key_h8hfne89vm'
CSRF_ENABLED = True
CSRF_SESSION_LKEY = 'dev_key_h8asSNJ9s9=+'
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@kentbrew
kentbrew / favicon-interceptor.js
Created January 3, 2011 19:32
How to short-circuit those annoying favicon requests in node.js
// early experiments with node had mysterious double requests
// turned out these were for the stoopid favicon
// here's how to short-circuit those requests
// and stop seeing 404 errors in your client console
var http = require('http');
http.createServer(function (q, r) {
// control for favicon