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 | |
// routes/console.php | |
// quickly create an user via the command line | |
Artisan::command('user:create', function () { | |
$name = $this->ask('Name?'); | |
$email = $this->ask('Email?'); | |
$pwd = $this->ask('Password?'); | |
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted | |
\DB::table('users')->insert([ |
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
" To get a list of Actions run `:actionlist ` | |
" let mapleader = ',' | |
" let mapleader = " " | |
let mapleader = "\<SPACE>" | |
set ignorecase smartcase | |
set NERDTree | |
set hlsearch | |
set showmode | |
set scrolloff=5 |
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
public function gravatar($email, $size = 70, $default = "monsterid") { | |
return "http://www.gravatar.com/avatar/" . | |
md5(strtolower($email)) . | |
"?s=" . (integer) $size . | |
"&d=" . urlencode($default) . | |
"&r=G"; | |
} |
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 http = require('http'); | |
var pg = require('pg'); | |
var connectionString = "pg://chartjes:********@localhost:5432/ibl_stats"; | |
pg.connect(connectionString, function(err, client) { | |
if (err) { | |
console.log(err); | |
} else { | |
http.createServer(function(request, response) { | |
response.writeHead(200, {'Content-Type': 'text/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
#!/bin/bash | |
# usage: time benchbulk.sh dbname | |
# it takes about 30 seconds to run on my old MacBook | |
BULKSIZE=1000 | |
DOCSIZE=100 | |
INSERTS=10 | |
ROUNDS=10 | |
DBURL="http://localhost:5984/$1" |