Skip to content

Instantly share code, notes, and snippets.

@lstroud
lstroud / index.html
Created April 6, 2012 00:52
d3 charts animation load
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@lstroud
lstroud / SafariTabsToEvernote.applescript
Created July 17, 2012 23:38
Alfred App Applescript to create an Evernote note containing an html list of the titles/links from all open tabs in the frontmost Safari window. It also creates a todo in Things with the link to the Evernote note.
on alfred_script(q)
if q is missing value then
set listname to text returned of (display dialog "Please Enter a Name" default answer "")
else
set listname to q
end if
tell application "Safari"
set theurls to get URL of every tab of front window
set thetitles to get name of every tab of front window
@lstroud
lstroud / build.sh
Created October 24, 2012 18:30 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@lstroud
lstroud / index.html
Last active December 14, 2015 23:39
scrolling experiment #html #snippet
<html>
<head>
<style>
*:not(html) {
-webkit-transform: translateZ(0);
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
}
body {
@lstroud
lstroud / index.html
Last active December 14, 2015 23:39
scrolling experiment
<html>
<head>
<style>
/* *:not(html) {
-webkit-transform: translateZ(0);
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-duration: 350ms;
}
@lstroud
lstroud / GItlab File Export
Last active August 29, 2015 13:58
Simple command line command for exporting file from gitlab to local file system using gitlab api.
Requires NodeJS and npm.
Install prerequisites:
npm install qs minimist path-extra
Usage: gitlab-file-export [options] url_to_export
This is intended for exporting individual files from
the respository and does not support tree exports.
Options:
@lstroud
lstroud / java_home.zsh
Created April 15, 2014 18:08
Functions to switch JVM (Java) versions on OSX
#functions placed in /etc/zshenv
alias java_ls='/usr/libexec/java_home -V 2>&1 | grep -E "\d.\d.(\d_\d\d|\d)" | cut -d , -f 1 | colrm 1 4 | grep -v Home'
alias java_home='/usr/libexec/java_home'
function java_use() {
removeFromPath $(/usr/libexec/java_home)/bin
export JAVA_HOME=$(/usr/libexec/java_home -v $1)
export PATH=$JAVA_HOME/bin:$PATH
java -version
}
@lstroud
lstroud / scrub_opml.groovy
Created April 25, 2014 19:29
This script will convert an opml feed list between file formats (XML, JSON, and CSV), scrub the list for feeds that are still active, filter the list by expression, and de-duplicate the feeds in the list. I built it because I needed to reorganize my feeds. Moving the feeds to a csv file, where the tag column is the folder(s), made it very quick …
/*
Copyright 2014 Les Stroud
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@lstroud
lstroud / gist:4703bad44c01c0c9a3da
Created May 9, 2014 20:37
xml xpath selector one-liners
curl -u aname "http://someserver/deploylist.xml" | xmllint --xpath '//deploy-name/text()' -
curl -u aname "http://someserver/deploylist.xml" | ruby -r nokogiri -e 'd=Nokogiri::XML($stdin); puts d.xpath("//deploy-name/text()")'
curl -u aname "http://someserver/deploylist.xml" | node -e "var i=process.stdin; i.resume(); i.on('data', function(d) { require('xpath').select('//deploy-name/text()', (new (require('xmldom')).DOMParser()).parseFromString(d.toString())).forEach(function(n){console.log(n.textContent);}); });"
@lstroud
lstroud / fetch_wwdc_pdfs.js
Created June 5, 2014 12:17
Download 2014 WWDC Slides (PDFs)
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
var auth = {
'user': 'appleid',
'pass': 'mypassword',
'sendImmediately': false
};