Skip to content

Instantly share code, notes, and snippets.

View welkerc's full-sized avatar

Christopher Welker welkerc

View GitHub Profile
//: Playground - noun: a place where people can play
import Cocoa
import Darwin
let rank = [1,2,3,4,5,6,7,8,9,10]
let player1 = Int(arc4random_uniform(UInt32(rank.count)))
let player2 = Int(arc4random_uniform(UInt32(rank.count)))
@welkerc
welkerc / bored.py
Last active January 28, 2017 00:21
import random
J = 11
Q = 12
K = 13
A = 14
rank = [1,2,3,4,5,6,7,8,9,10,J,Q,K,A]
player1 = rank[random.randint(0,13)]
player2 = rank[random.randint(0,13)]
@welkerc
welkerc / import.php
Created August 1, 2014 23:52
A csv import for postgresql using php.
<?php
include("include.php");
ini_set("auto_detect_line_endings", true);
$dir = '/path_to/folder/';
$files = scandir ( $dir, 1 );
foreach ($files as $value) {
if(strlen ($value) > 2 ){
$end_pos = strpos ( $value, "." );
$f = substr ( $value, 0, $end_pos );
$fname = $f;