Skip to content

Instantly share code, notes, and snippets.

View ahalbert's full-sized avatar

Armand Halbert ahalbert

View GitHub Profile
augroup VimjectsAutogroup
au BufNewFile,BufRead .vimjectrc* setlocal ft=vim
au VimEnter call vimjects#source("")
au VimEnter let g:kdsfjdfksdfjsfj = "hello"
au BufReadPre call vimjects#source("")
augroup end
class PlanDatesTest extends PHPUnit_Framework_TestCase
{
public function testDateDisplay() {
$this->assertEquals(PlanDates::dateDisplay(1438198178), "July 29, 2015");
$this->assertEquals(PlanDates::dateDisplay("2015-03-7"), "March 7, 2015");
}
public function testYearStart() {
$this->getMock('Util', array("isGrad"));
function safeCreateDir($dir, $exit = true) {
if (!file_exists($dir)) {
if (!mkdir($dir, 0700, true)) {
$processUser = posix_getpwuid(posix_geteuid());
error_log($dir." ".implode($processUser));
if ($exit) {
debugMail('failed to create dir: ' . $dir, true);
}
return false;
}
users
primary key
human/zombie/dead
npc?
admin?
star timer
name
living area
handle
Facebook account
This will make a single serving of an "Oatmeal in a Cup". Its taste and texture is similar to a muffin or a baked oatmeal dish.
1/2 cup of quick cook oatmeal
1/2 cup of milk
1 egg
1/3 apple, chopped
1/3 bannana
a generous dash of cinnamon
1 teaspoon of honey
function BayesNet(vars) {
this.variables = {};
this.numVars = Object.keys(this.variables).length;
for (v in vars) {
this.variables[v] = new BayesNode(vars[v]);
this.variables[v].CPTorder = this.generateDomainRows(vars[v].parents);
this.variables[v].fullCPT = {};
this.variables[v].blocks = false;
}
for (v in vars) {
function BayesNet(vars) {
this.variables = {};
this.numVars = Object.keys(this.variables).length;
for (v in vars) {
this.variables[v] = new BayesNode(vars[v]);
this.variables[v].CPTorder = this.generateDomainRows(this.variables[v].parents);
this.variables[v].fullCPT = {}
for (var i = 0; i < this.variables[v].CPTorder.length; i++) {
this.variables[v].fullCPT[this.variables[v].CPTorder[i]] = this.variables[v].CPT[i];
}
@ahalbert
ahalbert / gist:7236782
Created October 30, 2013 17:36
weather script
import urllib3
import re
import us
import string
import json
http = urllib3.PoolManager()
req = http.request('get', "http://icanhazip.com")
ip = req.data[:-1]
req = http.request('GET', 'http://api.ipinfodb.com/v3/ip-city/?key=APIKEY&ip=' + ip)