Skip to content

Instantly share code, notes, and snippets.

View ericvanjohnson's full-sized avatar
🐘
Probably doing PHP Stuff.

Eric Van Johnson ericvanjohnson

🐘
Probably doing PHP Stuff.
View GitHub Profile
@meigwilym
meigwilym / console.php
Last active March 5, 2024 02:20
Laravel Create User Command
<?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([
" 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
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";
}
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'});
@jchris
jchris / benchbulk.sh
Created March 15, 2009 02:48
benchmarking CouchDB bulk inserts in bash
#!/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"