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
#!/bin/bash | |
__FILE__="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" | |
__DIR__=`dirname $__FILE__` | |
# @params: $1 Message to display | |
function step { | |
echo -e "\033[0;36m==> \033[0;37m$1\033[0m" | |
} |
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 class="signal"><div class="spinner"><svg width="200" height="200"><path d="M140.773 59.227C137.316 55.77 130.055 50 100 50s-37.317 5.77-40.774 9.227C55.77 62.684 50 69.104 50 100s5.77 37.316 9.227 40.773C62.683 144.23 69.103 150 100 150c30.895 0 37.317-5.77 40.772-9.227C144.23 137.316 150 130.896 150 100s-5.77-37.317-9.227-40.773z"/><path d="M140.773 59.227C137.316 55.77 130.055 50 100 50s-37.317 5.77-40.774 9.227C55.77 62.684 50 69.104 50 100s5.77 37.316 9.227 40.773C62.683 144.23 69.103 150 100 150c30.895 0 37.317-5.77 40.772-9.227C144.23 137.316 150 130.896 150 100s-5.77-37.317-9.227-40.773z"/><path d="M140.773 59.227C137.316 55.77 130.055 50 100 50s-37.317 5.77-40.774 9.227C55.77 62.684 50 69.104 50 100s5.77 37.316 9.227 40.773C62.683 144.23 69.103 150 100 150c30.895 0 37.317-5.77 40.772-9.227C144.23 137.316 150 130.896 150 100s-5.77-37.317-9.227-40.773z"/></svg></div></div> |
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
<?php | |
function file_get_csv($filename, $use_first_row_as_keys = false, $delimiter = ',', $enclosure = '"', $escape = "\\"){ | |
$file = new SplFileObject($filename); | |
$file->setCsvControl($delimiter, $enclosure, $escape); | |
$file->setFlags(SplFileObject::READ_CSV | SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE); | |
$results = []; | |
if ($use_first_row_as_keys) { | |
$keys = $file->current(); | |
$file->next(); |
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
// Replace bucket in arn:aws:s3:::bucket/* with your bucket name. | |
{ | |
"Version":"2008-10-17", | |
"Statement":[{ | |
"Sid":"AllowPublicRead", | |
"Effect":"Allow", | |
"Principal": { | |
"AWS": "*" |
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
/** | |
* An example CORS-compliant method. It will allow any GET, POST, or OPTIONS requests from any | |
* origin. | |
* | |
* In a production environment, you probably want to be more restrictive, but this gives you | |
* the general idea of what is involved. For the nitty-gritty low-down, read: | |
* | |
* - https://developer.mozilla.org/en/HTTP_access_control | |
* - http://www.w3.org/TR/cors/ | |
* |
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 asyncLoadCSS (css_href) { | |
var css_link = function () { | |
var h = document.getElementsByTagName('head')[0] | |
var l = document.createElement('link') | |
l.rel = 'stylesheet' | |
l.href = css_href | |
h.parentNode.insertBefore(l, h) | |
}, RAF = requestAnimationFrame || mozRequestAnimationFrame | |
|| webkitRequestAnimationFrame || msRequestAnimationFrame | |
if (RAF) RAF(css_link); else window.addEventListener('load', css_link) |
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
<?php | |
/* | |
Esempio | |
*/ | |
foreach(getTweets([ | |
'api_key' => 'XXXXXXXXXX', | |
'api_secret' => 'XXXXXXXXXX', | |
'username' => 'CaffeinaLab', |
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
<?php | |
class C{static function __callStatic($n,$p){static$_;return($f=&$_[$n])?$f():$f=$p[0];}} | |
C::now(function(){ | |
return new DateTime(); | |
}); | |
var_dump(C::now()); | |
/* |
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
set $is_mobile 0; | |
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") { | |
set $is_mobile 1; | |
} | |
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t |
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
var app = require( 'app' ); | |
var BrowserWindow = require( 'browser-window' ); | |
var log = console.log; | |
//log( app ); | |
//log( process[ 'versions' ] ); | |
app.on( 'ready', function(){ | |
//log( "app ready" ); | |
var main_window = new BrowserWindow({ |