This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2008-10-17", | |
"Id": "http referer policy example", | |
"Statement": [ | |
{ | |
"Sid": "Allow get requests from certain domains (including local development)", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket-name-here/*", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var elasticsearch = require('elasticsearch'); | |
var Promise = require('bluebird'); | |
var log = console.log.bind(console); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200', | |
log: 'trace' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C# FizzBuzz Test | |
using System; | |
class FizzBuzz { | |
static void Main() { | |
for (int n = 1; n <= 100; n ++) { | |
if (n % 15 == 0) { | |
Console.WriteLine("FizzBuzz"); | |
} | |
else if (n % 3 == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log( self.innerWidth ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Reset Textskalierung */ | |
body { | |
-webkit-text-size-adjust: 100%; | |
} | |
/* Reset für Inputelemente */ | |
input { | |
-webkit-appearance: none; | |
-webkit-border-radius: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
<?php | |
/* PHP Slowloris | |
* Adapted from the script found here: http://seclists.org/fulldisclosure/2009/Jun/207 | |
* Contains get based attack (slow headers) and post based attack (long content length) | |
* | |
* Author: Seppe vanden Broucke | |
*/ | |
function usage($argv){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(milliseconds) { | |
var start = new Date().getTime(); | |
for (var i = 0; i < 1e7; i++) { | |
if ((new Date().getTime() - start) > milliseconds){ | |
break; | |
} | |
} | |
} | |
// Usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<div id="proto_1" data-state="open">Div 1 - proto open</div> | |
<div id="">Div 2</div> | |
<div id="proto_3" data-state="closed">Div 3 - proto closed</div> | |
<div id="proto_4" data-state="open">Div 4 - proto open</div> | |
*/ | |
var $el = $('div[id^=proto_]').filter('div[data-state=open]').css('color','red'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.addTouch = function(){ | |
this.each(function(i,el){ | |
$(el).bind('touchstart touchmove touchend touchcancel',function(){ | |
//we pass the original event object because the jQuery event | |
//object is normalized to w3c specs and does not provide the TouchList | |
handleTouch(event); | |
}); | |
}); | |
var handleTouch = function(event) |