Skip to content

Instantly share code, notes, and snippets.

Seth Ladd sethladd

View GitHub Profile
@sethladd
sethladd / sortings.dart
Created Mar 10, 2014
Experiments with sorting algorithms in Dart, from Wikipedia articles.
View sortings.dart
import 'dart:math';
// http://en.wikipedia.org/wiki/Bubble_sort
void bubble(List list) {
var n = list.length;
while (n != 0) {
var newn = 0;
for (var i = 1; i < n; i++) {
if (list[i-1] > list[i]) {
@sethladd
sethladd / pubspec.yaml
Created Mar 24, 2014
dart:js and package:js test for code size
View pubspec.yaml
name: testjsinterop
description: A sample web application
dependencies:
browser: any
js: any
quiver: any
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
#core_header_panel {
@sethladd
sethladd / gist:44830
Created Jan 8, 2009
example ruby and libxml code
View gist:44830
require 'rubygems'
require 'libxml'
doc = LibXML::XML::Document.file('test.xml')
rs = doc.find('//R')
rs.each do |r|
u = r.find_first('U')
s = r.find_first('S')
puts "S: #{s} and U: #{u}"
end
rs = nil
@sethladd
sethladd / gist:90690
Created Apr 6, 2009
load two files via Pig and join them
View gist:90690
people = LOAD 'people' USING PigStorage(',') AS (ssn,date,uic);
medical_cases = LOAD 'medical_cases' USING PigStorage(',') AS (ssn,data,icd9);
joined = JOIN people BY ssn , medical_cases BY ssn;
STORE joined INTO 'out' USING PigStorage(',');
View gist:104210
~/Development/dses-rails-2.2.2/dses2 $ svn diff
Index: vendor/gems/rails-sqlserver-2000-2005-adapter-2.2.16/lib/active_record/connection_adapters/sqlserver_adapter.rb
===================================================================
--- vendor/gems/rails-sqlserver-2000-2005-adapter-2.2.16/lib/active_record/connection_adapters/sqlserver_adapter.rb (revision 18159)
+++ vendor/gems/rails-sqlserver-2000-2005-adapter-2.2.16/lib/active_record/connection_adapters/sqlserver_adapter.rb (working copy)
@@ -1043,7 +1043,7 @@
WHEN COLUMNPROPERTY(OBJECT_ID(columns.TABLE_NAME), columns.COLUMN_NAME, 'IsIdentity') = 0 THEN NULL
ELSE 1
END as is_identity
- FROM #{db_name}INFORMATION_SCHEMA.COLUMNS columns
@sethladd
sethladd / gist:119039
Created May 28, 2009 — forked from dburger/gist:118842
create a new bare shared git repository
View gist:119039
ssh gitserver.com
mkdir -p /var/data/repos/myrepo.git
cd /var/data/repos/myrepo.git
git --bare init --shared=group
View display git branch on prompt.sh
parse_git_branch (){
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1='\[\033[0;33m\]\w\[\033[00m\]\[\033[01;00m\]$(parse_git_branch): '
@sethladd
sethladd / check_wordpress_blogger_links.rb
Created Mar 10, 2010
Migrate from Wordpress to Blogger
View check_wordpress_blogger_links.rb
@sethladd
sethladd / .bash_profile
Created Mar 14, 2010 — forked from aeden/gist:331864
.bash_profile
View .bash_profile
export PATH=$PATH:/Users/sladd/.gem/ruby/1.8/bin
alias gst='git status '
alias gc='git commit '
alias gca='git commit -a '
alias ga='git add '
alias gco='git checkout '
alias gb='git branch '
alias gm='git merge '
alias gp='git push '
You can’t perform that action at this time.