Consider a list of strings you need to permanently assign a random color.
First you should turn the string into a hash.
var string = "string"
var hash = 0
@servers(['web' => '[email protected]']) | |
@setup | |
$dir = '/var/www' | |
@endsetup | |
@task('deploy') | |
cd {{ $dir }}; | |
echo Putting website in maintenance | |
php artisan down |
#Convert a HTML input 2-dimensional array into an array of keys-values
We get this JSON input:
{
"number":[
"1241",
"1241"
],
This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.
This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.
I'm available for tutoring and code review :)
You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the controller to call when that URI is requested. |
<?php | |
/** | |
* Simple string encryption/decryption function. | |
* CHANGE $secret_key and $secret_iv !!! | |
**/ | |
function stringEncryption($action, $string){ | |
$output = false; | |
$encrypt_method = 'AES-256-CBC'; // Default |
.ModalOverlay { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
background: rgba(0, 0, 0, 0.29); | |
z-index: 1000; | |
overflow: hidden; | |
} | |
.ModalOverlay .Modal { |
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
<?php | |
class Arr | |
{ | |
/** | |
* Remove keys from input array that are not in the whitelist | |
* | |
* // Get the values "username", "password" from $_POST | |
* $auth = Arr::filterKeys($_POST, array('username', 'password')); |
<?php | |
/** | |
* Lietuviškų vardų linksniai. | |
* | |
* @author Dainius Kaupaitis <dainius at kaupaitis dot lt> | |
* @copyright Copyleft (ↄ) 2011, Dainius Kaupaitis | |
* @version 1.0 | |
* @package Vardai | |
*/ |