Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
declare -r SESSION_NAME=work
# If we don't have a session, then create one with the default windows.
if ! tmux has-session -t $SESSION_NAME 2>/dev/null; then
# Create a new session with the first window named "emacs". Immediately detach.
tmux new-session -d -n emacs -s $SESSION_NAME
# Create a new window named dev. Repeat this for as many new windows you like.
tmux new-window -n dev -t $SESSION_NAME
@pope
pope / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@pope
pope / gist:4902
Created August 11, 2008 17:37 — forked from anonymous/gist:4900
require 'autotest/redgreen'
module Autotest::Growl
def self.growl title, msg, img, pri=0, stick=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}"
end
Autotest.add_hook :ran_command do |autotest|
results = [autotest.results].flatten.join("\n")
output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/)
#taken and modified from http://github.com/dkubb/dm-dev/tree/master
desc 'Strip trailing whitespace from source files'
task :strip do
require 'pathname'
require 'zlib'
# files and extensions to process
files = %w[ capfile CHANGELOG MIT-LICENSE README README_FOR_APP RUNNING_UNIT_TESTS Rakefile TODO USAGE .autotest .gitignore ].freeze
extensions = %w[ builder cgi conf css deploy erb example fcgi haml htc htm html js java key opts php properties rake ratom rb rcsv rdf rhtml rjs rpdf rxml sake sass sh sql txt vcf xml yml ].freeze
require 'rubygems'
require 'twitter'
require 'ruby-growl'
require 'simple-daemon'
require 'tempfile'
require 'net/http'
class Growitter < SimpleDaemon::Base
SimpleDaemon::WORKING_DIRECTORY = "/Users/dir/Desktop"
function Set() {
this.data = {};
this.length = 0;
for (var i = 0; i !== arguments.length; i++) {
this.add(arguments[i]);
}
}
(function(proto) {
function eachProp(obj, fn) {
@pope
pope / Component.java
Created October 23, 2008 17:51
JRuby Bug
class Component {
private Integer id;
public Integer getID() { return id; }
public void setID(id) { this.id = id; }
}
@pope
pope / fbr.rb
Created November 15, 2008 15:01 — forked from tmm1/fbr.rb
# Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8)
# (c) 2008 Aman Gupta (tmm1)
unless defined? Fiber
require 'thread'
class FiberError < StandardError; end
class Fiber
def initialize
eth0 Link encap:Ethernet HWaddr 08:00:27:c3:b9:89
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1698 (1.6 KB) TX bytes:3428 (3.4 KB)
Interrupt:11 Base address:0xc020
eth1 Link encap:Ethernet HWaddr 08:00:27:c3:62:0c
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0 Link encap:Ethernet HWaddr 08:00:27:c3:b9:89
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9690 (9.6 KB) TX bytes:3078 (3.0 KB)
Interrupt:11 Base address:0xc020
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0