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/sh | |
sudo yum install -y gcc | |
wget http://download.redis.io/releases/redis-2.8.17.tar.gz | |
tar xzf redis-2.8.17.tar.gz | |
cd redis-2.8.17 | |
make | |
sudo cp ./src/redis-server /usr/local/bin/ | |
sudo cp ./src/redis-cli /usr/local/bin/ |
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 | |
STATUS=`defaults read com.apple.finder AppleShowAllFiles` | |
if [ $STATUS == YES ]; | |
then | |
defaults write com.apple.finder AppleShowAllFiles NO | |
else | |
defaults write com.apple.finder AppleShowAllFiles YES | |
fi | |
killall -TERM Finder |
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 | |
namespace App\Http\Utilities; | |
class Country { | |
protected static $countries = [ | |
"United States" => "us", | |
"Afghanistan" => "af", | |
"Albania" => "al", | |
"Algeria" => "dz", |
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
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
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 convert_state(name, to) { | |
var name = name.toUpperCase(); | |
var states = new Array( {'name':'Alabama', 'abbrev':'AL'}, {'name':'Alaska', 'abbrev':'AK'}, | |
{'name':'Arizona', 'abbrev':'AZ'}, {'name':'Arkansas', 'abbrev':'AR'}, {'name':'California', 'abbrev':'CA'}, | |
{'name':'Colorado', 'abbrev':'CO'}, {'name':'Connecticut', 'abbrev':'CT'}, {'name':'Delaware', 'abbrev':'DE'}, | |
{'name':'Florida', 'abbrev':'FL'}, {'name':'Georgia', 'abbrev':'GA'}, {'name':'Hawaii', 'abbrev':'HI'}, | |
{'name':'Idaho', 'abbrev':'ID'}, {'name':'Illinois', 'abbrev':'IL'}, {'name':'Indiana', 'abbrev':'IN'}, | |
{'name':'Iowa', 'abbrev':'IA'}, {'name':'Kansas', 'abbrev':'KS'}, {'name':'Kentucky', 'abbrev':'KY'}, | |
{'name':'Louisiana', 'abbrev':'LA'}, {'name':'Maine', 'abbrev':'ME'}, {'name':'Maryland', 'abbrev':'MD'}, | |
{'name':'Massachusetts', |
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 | |
/* | |
//Normal query | |
User::all(); | |
//Cached query (default 60min) | |
User::cached()->all(); | |
//Cached query (5min) |
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
details summary { | |
cursor: pointer; | |
outline: none !important; | |
display: inline-block; | |
padding: 8px 12px; | |
padding-top: 10px; | |
border-radius: 4px; | |
overflow: hidden; | |
background: #F09825; | |
color: white; |
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
{ | |
"private": true, | |
"scripts": { | |
"dev": "npm run development", | |
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "npm run development -- --watch", | |
"watch-poll": "npm run watch -- --watch-poll", | |
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"prod": "npm run production", | |
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" |
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
// This one is interesting because no previously checked condition is re-checked | |
// It is a self-executing function that contains a declarative function named fizzbuzz() and a for loop | |
// Too much fun | |
(function() { | |
function fizzbuzz(i) { | |
const test = (d, s, x) => i % d == 0 ? _ => s + x('') : x | |
const fizz = x => test(3, 'Fizz', x) | |
const buzz = x => test(5, 'Buzz', x) | |
console.log(fizz(buzz(x=>x))(i.toString())) | |
} |
OlderNewer