Skip to content

Instantly share code, notes, and snippets.

View kliph's full-sized avatar

Cliff Rodgers kliph

  • Philadelphia, PA
View GitHub Profile
@stephenturner
stephenturner / pvalue-from-lm-object.r
Created November 30, 2010 17:46
pvalue-from-lm-object.r
# Function to extract the overall ANOVA p-value out of a linear model object
lmp <- function (modelobject) {
if (class(modelobject) != "lm") stop("Not an object of class 'lm' ")
f <- summary(modelobject)$fstatistic
p <- pf(f[1],f[2],f[3],lower.tail=F)
attributes(p) <- NULL
return(p)
}
# simulate some data
*.bak
ref/*
*nytprof*
@maio
maio / gist:2862867
Created June 3, 2012 09:58
Smart semi-colon in Emacs (and Vim)
;; Port of Coderush's smart semi-colon feature to Emacs
;;
;; When I hit semi-colon anywhere, Emacs will move cursor to the end of current
;; line and insert semi-colon (if it's not already there).
;;
;; Idea from last @CoderetreatCZ - HK
(defun maio/electric-semicolon ()
(interactive)
(end-of-line)
# response to http://jumpstartlab.com/news/archives/2013/04/23/the-death-of-ifs
#-----------------
# Commands :
#-----------------
class Command
class Quit ; def execute ; exit end end
class Invalid ; def execute ; puts 'invalid command' end end
class Tweeting ; def execute ; puts "tweeting" end end
@rogerallen
rogerallen / red-frik-130511.clj
Last active December 17, 2015 06:18
an attempt to translate https://twitter.com/redFrik/status/333317729073381377 play{a=LFSaw;mean({|i|Ringz.ar(Blip.ar(a.ar(i+1/[3,4])>(a.ar(i+1/8)+1)*25+50,i+[2,3])*a.ar(i+1/50,i/25),i+1*99,0.1)}!50)/5} to Overtone
;; an attempt to translate
;; https://twitter.com/redFrik/status/333317729073381377
;; play{a=LFSaw;mean({|i|Ringz.ar(Blip.ar(a.ar(i+1/[3,4])>(a.ar(i+1/8)+1)*25+50,i+[2,3])*a.ar(i+1/50,i/25),i+1*99,0.1)}!50)/5}
;; to Overtone
;;
;; play {
;; a=LFSaw;
;; mean(
;; { |i|
;; Ringz.ar(
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@michaelfairley
michaelfairley / stuff.md
Last active June 11, 2017 21:02
Makin' Games with Ruby
@rogerallen
rogerallen / beethoven.clj
Last active January 1, 2016 04:39
Code works!
(ns explore-overtone.beethoven
(:use [overtone.live]))
;; Beginning with some of the ideas in Sam Aaron's example[1],
;; let's see about trying to get rid of the limitation on sequence
;; length.
;;
;; I'd like to create a composition outside the server in "beat space"
;; (play note N at beat B). This should allow for composing notes via
;; an abstraction that a library like Leipzig [2] provides. But,
anonymous
anonymous / emacs.memory.leak.aka.distnoted.patch.diff
Created January 22, 2014 03:45
This is a patch (with commentary) that fixes a memory leak in 24.3 for OSX Mavericks (10.9) users who experience excessive resource consumption by distnoted.
From 8ab91751069e391a95151c6716a546b1732ade92 Mon Sep 17 00:00:00 2001
From: JP <twitter:canoeberry>
Date: Sun, 19 Jan 2014 11:58:54 +0000
Subject: [PATCH] partial memleak fix
This patch was created by JP (twitter: @canoeberry) based on a memleak fix by Dirk (emacs committer) below:
https://github.com/mirrors/emacs/commit/57ae6509a3b6a274f89b9caea0284c6156470625
This memory leak is fixed in the trunk as of now and will be in the next official release: 24.4.
anonymous
anonymous / gist:11201010
Created April 23, 2014 02:32
using Microsoft.Xna.Framework;
using Monocle;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TowerFall
{
public class PlayerHair : Component