Skip to content

Instantly share code, notes, and snippets.

11:37 ChameleonSix: ah cya later
11:37 ChameleonSix has left IRC (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
11:37 TheKiwi has left IRC (Ping timeout: 250 seconds)
11:37 l1x has left IRC (Ping timeout: 250 seconds)
11:37 zeller has left IRC (Ping timeout: 250 seconds)
11:37 pygirl24 has left IRC (Ping timeout: 250 seconds)
11:37 sublee has left IRC (Ping timeout: 252 seconds)
11:37 Somnius has left IRC (Ping timeout: 252 seconds)
11:37 merlinsbrain has left IRC (Ping timeout: 252 seconds)
11:37 topecnz has left IRC (Ping timeout: 252 seconds)
@John2496
John2496 / addthis.js
Last active August 29, 2015 14:15
AddThis events don't fire on mobile (iPhone 6 - iOS 8.1). :[
setTimeout(function() {
// Set arbitrary delay to ensure addthis loads up
addthis.addEventListener('addthis.menu.open', function(evt) {
alert("pls work");
});
}, 10000);
<VirtualHost *:80>
RewriteEngine On
RewriteMap lowercase int:tolower
# if already rewitten and we have the right path, stop right here
#RewriteCond /var/www/vhosts/${lowercase:%{SERVER_NAME}/htdocs} !-d
#RewriteRule ^/(.*)$ /var/www/vhosts/_default/htdocs/$1 [L,E=VHOST_ROOT:/var/www/vhosts/_default/htdocs]
RewriteRule ^(/var/www/vhosts/[^/]+/.*)$ $1
_gaq.push(
['test', 'test']
['fucking', 'killme']
);
@John2496
John2496 / gist:7a1950eb74dc641a79d1
Last active July 29, 2016 09:39
reddit blog source code leak
<!--
LEAKED SOURCE FROM http://www.redditblog.com/2014/08/blog-post-471.html
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir='ltr' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
<script type="text/javascript">(function() { var b=window,f="chrome",g="tick",k="jstiming";(function(){function d(a){this.t={};this.tick=function(a,d,c){var e=void 0!=c?c:(new Date).getTime();this.t[a]=[e,d];if(void 0==c)try{b.console.timeStamp("CSI/"+a)}catch(h){}};this[g]("start",null,a)}var a;b.performance&&(a=b.performance.timing);var n=a?new d(a.responseStart):new d;b.jstiming={Timer:d,load:n};if(a){var c=a.navigationStart,h=a.responseStart;0<c&&h>=c&&(b[k].srt=h-c)}if(a){var e=b[k].load;0<c&&h>=c&&(e[g]("_wtsrt",void 0,c),e[g]("wtsrt_","_wtsrt",h),e[
@John2496
John2496 / gist:a2823bd1c04e5d83fa6c
Last active February 6, 2017 16:31
Project managers don't want you to know about this one simple tip...
<?php
// simple technique to remove bugs from your code
// example buggy code
$your_code = "<html><Oh man>i hope i don't have any American cockroaches in my code</Oh man></html>";
$list_of_bugs = array('American cockroach', 'Ants', 'Aphids', 'Aphids', 'Asian paper wasp',
'Asian paper wasp nest', 'Assassin bug', 'Australian bag moth', 'Australian bag moth pupa',
'Avondale spider', 'Backswimmer', 'Bamboo moth', 'Banana moth', 'Banana moth pupa',
@media (min-width: 600px) {
body {
color: red;
border: red 2px solid;
}
}
@John2496
John2496 / gist:7421901
Last active December 28, 2015 01:39
batch update breadcrumb structure
<?php
$query = new EntityFieldQuery();
$result = $query->entityCondition('entity_type', 'node')
->propertyCondition('type', 'news')
->execute();
$item_nids = array_keys($result['node']);
$items = entity_load('node', $item_nids);
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
RewriteEngine On
RewriteMap lowercase int:tolower
# If already rewitten and we have the right path, stop right here
#!/usr/bin/env ruby
require 'fileutils'
require 'optparse'
require 'sqlite3'
options = { }
OptionParser.new do |opts|
opts.banner = "Sup search"