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
(define (toHex dec) | |
;local-function:solveHex | |
(define (solveHex dec res) | |
(let ((base 16)) | |
(cond | |
[(null? dec) res] | |
[(>= dec (- base 1)) (solveHex (quotient dec base) (string-append (getHex (remainder dec base)) res) )] | |
[else (string-append (getHex dec) res)] | |
) | |
) |
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
#attempt 2 | |
sudo iwlist wlan0 scan | |
sudo iwconfig wlan0 essid $WIFI key $KEY | |
sudo dhclient wlan0 |
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
SITE="laravel" | |
USER="dev" | |
cat >> $SITE-setup.sql << EOF | |
CREATE DATABASE ${SITE}; | |
GRANT ALL PRIVILEGES ON ${SITE}.* TO '${USER}'@'localhost' identified by ''; | |
FLUSH PRIVILEGES; | |
EOF | |
mysql -u root -p < $SITE-setup.sql |
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
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
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 | |
echo ">>> Installing Elasticsearch" | |
cd /opt | |
sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jre-8u40-linux-x64.tar.gz" | |
sudo tar xvf jre-8*.tar.gz |
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
--- | |
ip: "192.168.33.11" | |
memory: 2048 | |
cpus: 1 | |
hostname: laravel5-dev | |
name: laravel5-dev | |
provider: virtualbox | |
authorize: .homestead/homestead@laravel5.dev.pub |
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
/* | |
|---------------------------------------------------------------- | |
| Have a Drink! | |
|---------------------------------------------------------------- | |
| | |
*/ | |
// --- INIT | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), // compiles sass to CSS |
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
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
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
#clear all the npms | |
npm -g ls | grep -v 'npm@' | awk '/@/ {print $2}' | awk -F@ '{print $1}' | xargs npm -g rm | |
#remove all the binaries | |
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} | |
#compile | |
wget http://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz | |
tar -xzf node-v0.10.40.tar.gz | |
./configure |
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
var page = require('webpage').create(); | |
page.open('http://net.tutsplus.com', function () { | |
var title = page.evaluate(function () { | |
var posts = document.getElementsByClassName("post"); | |
posts[0].style.backgroundColor = "#000000"; | |
return document.title; | |
}); | |
page.clipRect = { top: 0, left: 0, width: 600, height: 700 }; | |
page.render(title + ".png"); |
OlderNewer