Skip to content

Instantly share code, notes, and snippets.

View lukeholder's full-sized avatar
👾

Luke Holder lukeholder

👾
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lukeholder on github.
  • I am luke (https://keybase.io/luke) on keybase.
  • I have the public key with fingerprint 1A94 E384 7341 0E2D 8B8F  73E2 32AF 990F C487 DB59

To claim this, I am signing this object:

@lukeholder
lukeholder / file.csv
Created April 9, 2014 08:07
non standard csv file with comment lines
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 17. in line 1.
; This is a comment
DC,4470-001,,01-405,G,3,16/03/2014,16/03/2014,Payroll Costing 16/03/14,0,,468.02,,,101001,,
DC,4470-001,,01-405,G,3,16/03/2014,16/03/2014,Leave Accrual,0.57,,33.34,,,101001,,
; Another comment
DC,4470-001,,01-410,G,3,16/03/2014,16/03/2014,Payroll Costing 16/03/14,0,,4212.18,,,101001,,
DC,4470-001,,01-410,G,3,16/03/2014,16/03/2014,Leave Accrual,5.57,,325.66,,,101001,,
; Another comment
GL,16/03/2014,16/03/2014,Generated recovery,5039.20,110-60002-51-8002.001,,101001,,,,,,,,,
GL,16/03/2014,16/03/2014,Generated recovery,-5039.20,110-60002-51-6535.001,,101001,,,,,,,,,
GL,16/03/2014,16/03/2014,Payroll Costing 16/03/14,-2883.61,130-00000-00-3210.000,,101001,,,,,,,,,
@lukeholder
lukeholder / download.bash
Last active August 29, 2015 14:01
How do download all cartslyst repos from the command line. no need to subscribe all the time
mkdir Cartalyst
cd Cartalyst
curl -s https://api.github.com/orgs/jenkinsci/repos | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}'
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5]
func partition(v: Int[], left: Int, right: Int) -> Int {
var i = left
for j in (left + 1)..(right + 1) {
if v[j] < v[left] {
i += 1
(v[i], v[j]) = (v[j], v[i])
}
}
class CellarSession implements \Cartalyst\Cart\Storage\StorageInterface
{
public function getKey()
{
return "cellar";
}
public function identify()
{
@lukeholder
lukeholder / timberline-sage-300.rb
Created July 8, 2014 04:45
Connect to Timberline Sage 300 from Ruby on Windows through ODBC using the Sequel Gem
require 'sequel'
connection_string = 'driver={Timberline Data};dbq=\\\\doric-server19\\Timberline Office\\Gold\\DORIC GROUP\\;codepage=1252;dictionarymode=0;standardmode=1;maxcolsupport=1536;shortenames=0;databasetype=1;uid=luke;pwd=Awesome;'
db = Sequel.odbc(:driver=>'Timberline Data',:drvconnect=>connection_string)
# I found this returns true sometimes even if the connection is not working.
puts db.test_connection
master_company = db.fetch('SELECT * FROM ABM_MASTER__COMPANY').all
require 'sequel'
connection_string = 'driver={Timberline Data};dbq=\\\\doric-server19\\Timberline Office\\Gold\\DORIC GROUP\\;codepage=1252;dictionarymode=0;standardmode=1;maxcolsupport=1536;shortenames=0;databasetype=1;uid=l;pwd=Doricsep14;'
DB = Sequel.odbc(:driver=>'Timberline Data',:drvconnect=>connection_string)
DB.extend_datasets do
Sequel::Dataset.def_sql_method(self, :select, %w'select distinct limit columns into from join where group order having compounds')

Code Hint Helpers for PHP Storm

Add this code block into the phpdoc of Craft's WebApp.php class.

This will enable PHP Storm IDE features for services like craft()->market_product->method()

 * @property Market_AddressService         $market_address
 * @property Market_CartService            $market_cart
 * @property Market_CountryService         $market_country
<?php
require "simplenoteapi.php";
$notesocket = new simplenoteapi;
$notesocket->login('me@gmail.tld', 'pass');
$eachnote = $notesocket->index();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML 5</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>