This file contains 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
<?php | |
$series_sizes = [10, 100, 200, 300, 1000, 10000]; | |
//$series_sizes = [10, 100]; | |
$range_max = 3; | |
foreach ($series_sizes as $series_size) | |
{ | |
$series_arr[$series_size] = generate_series($series_size, $range_max * -1, $range_max); |
This file contains 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
set @sum=0; | |
select mea1_count, num_members, @sum:=@sum+num_members from ( | |
SELECT | |
mea1_count, | |
count(mem_id) num_members | |
FROM ( | |
SELECT | |
mea1.mem_id, | |
count(mea1.id) mea1_count |
This file contains 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
find . -size -$1b -delete |
This file contains 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
#!/bin/bash | |
years=`seq 2014 2015` | |
months=`seq -w 01 12` | |
for year in ${years[@]}; do | |
mkdir $year | |
for month in ${months[@]}; do | |
mkdir $year/$month | |
mv $year-$month-* $year/$month | |
done |
This file contains 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 bash | |
for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i}\n"; done |
This file contains 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
{ | |
"size": 0, | |
"query": { | |
"filtered": { | |
"query": { | |
"query_string": { | |
"query": "*", | |
"analyze_wildcard": true | |
} | |
}, |
This file contains 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
DELETE /test | |
PUT /test | |
{ | |
"mappings": { | |
"nospace": { | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, |
This file contains 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
#!/bin/bash | |
#set -x | |
githooks/post-checkout-revision.sh | |
githooks/post-checkout-composer.sh |
This file contains 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
// refer to https://gist.github.com/paulirish/5558557 | |
try { | |
if (!window.localStorage || !window.sessionStorage) throw "exception"; | |
localStorage.setItem('storage_test', 1); | |
localStorage.removeItem('storage_test'); | |
} catch(e) { | |
(function () { | |
var Storage = function (type) { |