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/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/sceaga/homebrew/tarball/tiger anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" 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
tell application "iCal" | |
set results to "" | |
set todaysDate to current date | |
repeat with a in every calendar | |
set results to results & return & (name of a) | |
tell a | |
set eventList to {} | |
repeat with b in every event | |
if (recurrence of b) = "FREQ=YEARLY;WKST=SU" then | |
set startDate to start date of b |
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
/* DataTables plug-in to allow for a custom Data Value for sorting based on a comment */ | |
jQuery.fn.dataTableExt.aTypes.unshift(function(sData) { | |
/* Look for a special comment <!-- CDx:<data> --> if found then return that type */ | |
if (sData.indexOf('<!-- CDI:') >= 0) { | |
return 'comment-dt-integer'; | |
} else if (sData.indexOf('<!-- CDS:') >= 0) { | |
return 'comment-dt-string'; | |
} else if (sData.indexOf('<!-- CDF:') >= 0) { | |
return 'comment-dt-float'; | |
} else if (sData.indexOf('<!-- CDD:') >= 0) { |
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
<?php | |
/* This gist is offered as is, make sure to test in your environment | |
* | |
* This class can be used to iterate over a large Eloquent query. It uses a combination of the PDO Fetch and | |
* the chunk methods to collect a series of items in memory. The chunk part was necessary in order to implement | |
* eager loading options. You can set the CHUNK_SIZE in the code to set how many rows to load in memory at a time | |
* again for the eager loading purposes. | |
* | |
* I am sure there are other ways to implement this technique more effectively |