Skip to content

Instantly share code, notes, and snippets.

View jefflarkin's full-sized avatar
🙃
Happy

Jeff Larkin jefflarkin

🙃
Happy
View GitHub Profile
@jefflarkin
jefflarkin / keybase.md
Created May 28, 2015 15:03
Keybase Identify Verification

Keybase proof

I hereby claim:

  • I am jefflarkin on github.
  • I am jefflarkin (https://keybase.io/jefflarkin) on keybase.
  • I have a public key whose fingerprint is 13D8 BCCC 1A50 57D3 FB4F E33A 950C 167F 0C1A 041D

To claim this, I am signing this object:

@jefflarkin
jefflarkin / JQuery Sortable Searialize
Created February 7, 2009 22:01
Sample code using JQuery Sortable lists. I've fixed my mistake, the code below should now work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
#sortable ul {
list-style: none;
display: inline;
padding: 0;
margin-left: 0;
http://chart.apis.google.com/chart?cht=lc&chs=400x250&chd=t:24.4,28.1,25.6,24.3|26,26&chds=23.0,30.0&chco=ff0000,0000ff&chxt=y&chxr=0,23,30&chdl=Economy|Average&chf=bg,lg,90,888888,0.5,dddddd,0&chxs=0,ffffff&chma=25,25,25,25
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/base/base-min.css"/>
<style media="all" type="text/css">
#admin {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css"/>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/base/base-min.css"/>
<style media="all" type="text/css">
html, body {
# Sanitizing/Escaping HTML in the view is inefficient because it
# happens every time the view is rendered. This module forces
# text and string fields to be sanitized every time they are
# modified and saved to the database.
module Sanitizer
def sanitize_fields
columns = self.class.columns_hash
changes.each do |key,value|
if columns[key].type == :text
Sanitize.clean! value[1], Sanitize::Config::TEXTAREA
@jefflarkin
jefflarkin / gist:518961
Created August 11, 2010 13:19
My Favorite BASH Trick
$ make foo
...
$ ^foo^bar
make bar
@jefflarkin
jefflarkin / charactersheet.xml
Created September 21, 2011 01:14
LOTRO Data API Results
<?xml version="1.0" encoding="UTF-8" ?>
- <apiresponse>
- <character name="Mathrid" world="Crickhollow" monster="0" race="Race of Man" race_id="23" class="Champion" class_id="172" level="30" origin="Dale" origin_id="16">
- <vocation name="Woodsman" vocation_id="1879062814">
- <professions>
<profession name="Woodworker" profession_id="1879055941" proficiency="2" mastery="1" icon_profession="http://lorebook.lotro.com/icon.php?type=profession&id=1879055941" />
<profession name="Farmer" profession_id="1879062816" proficiency="0" mastery="0" icon_profession="http://lorebook.lotro.com/icon.php?type=profession&id=1879062816" />
<profession name="Forester" profession_id="1879062817" proficiency="2" mastery="2" icon_profession="http://lorebook.lotro.com/icon.php?type=profession&id=1879062817" />
</professions>
</vocation>
@jefflarkin
jefflarkin / 1test.F90
Created October 25, 2012 14:42
Testing Derived Types with OpenACC
module dtmod
implicit none
private
integer, public, parameter :: N = 64
type, public :: mytype
sequence
real(8) :: a(N,N)
real(8) :: b(N,N)
end type mytype
end module
@jefflarkin
jefflarkin / profile.sh
Last active December 16, 2015 01:39
Quick trick for getting different cuda command-line profiler log files per node on a Cray XK7.
#!/bin/bash
# USAGE: Add between aprun options and executable
# For Example: aprun -n 16 -N 1 ./foo arg1 arg2
# Becomes: aprun -n 16 -N 1 ./profile.sh ./foo arg1 arg2
# Enable command-line profiler
export COMPUTE_PROFILE=1
# Set output to CSV (optional)
export COMPUTE_PROFILE_CSV=1