This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Grepr | |
def initialize(options, pattern) | |
@paths = [] | |
@pattern = pattern | |
@noregex = options.include?('n') | |
@pattern = "'#{@pattern}'" if pattern.include?(' ') | |
options.each_char do |opt| | |
case opt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrate/20091123163221_create_orders.rb | |
class CreateOrders < ActiveRecord::Migration | |
def self.up | |
create_table :orders do |t| | |
t.string :name | |
t.timestamps | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified version of "Database documentation in 50 lines of Sinatra" | |
# at http://www.alandelevie.com/2010/10/26/database-documentation-in-50-lines-of-sinatra/ | |
# (Works with Postgres and MySQL. Possibly sqlite too.) | |
# | |
# Useful for quickly comparing two database structures: | |
# 1) Run with a connection to db1 and choose the sorted view. | |
# 2) Copy the table structures into the left-hand side of a diff viewer. | |
# 3) Run with a connection to db2 and choose the sorted view. | |
# 4) Copy the table structures into the right-hand side of a diff viewer. | |
# 5) Compare... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
USAGE=<<EOS | |
Delete files in specified folders that are older than a given number of days. | |
Options: | |
-v - verbose. Will list folders and files. | |
-d - dry run. Like verbose, but does not delete files. | |
-h - Show this usage help. | |
Arguments: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/> | |
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.8.16.custom.css" type="text/css"/> | |
<link rel="stylesheet" href="examples.css" type="text/css"/> | |
<link rel="stylesheet" href="../controls/slick.columnpicker.css" type="text/css"/> | |
<style> | |
.slick-cell-checkboxsel { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Format code with syntax highlighting for pasting in emails. | |
# To use: | |
# 1) Highlight the code. | |
# 2) fmail ruby/sql/java_script etc... | |
# 3) Middle-click in email to paste html code. | |
require 'coderay' | |
require 'open3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
// register namespace | |
$.extend(true, window, { | |
"Slick": { | |
"CheckboxSelectColumn": CheckboxSelectColumn | |
} | |
}); | |
function CheckboxSelectColumn(options) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Inspired by Jamis Buck's blog entry: | |
# http://weblog.jamisbuck.org/2015/3/17/task-tracking-for-neurochemical-brains.html | |
# Go to tasks folder and open (or create) today's task file | |
# and the previous task file in vim. | |
cd ~/tasks | |
TODAY="tasks_`date '+%Y_%m_%d'`.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Format code with syntax highlighting for pasting in emails. | |
# To use: | |
# 1) Highlight the code. | |
# 2) fmail ruby/sql/java_script etc... | |
# 3) Middle-click in email to paste html code. | |
# | |
# CLI program xclip must be installed. http://sourceforge.net/projects/xclip/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="dist/ag-grid-enterprise.js"></script> | |
</head> | |
<body> | |
<h1>Simple ag-Grid Example</h1> | |
<div id="myGrid" style="height: 100%;" class="ag-blue" data-gridurl="/list/menu_definitions/grid" data-grid="grid"> | |
<script type="text/javascript"> | |
(function() { |