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 | |
# For the truly lazy (like myself) -- By Louis St-Amour | |
# | |
# A quick script to enable drag & drop reordering by default. | |
# | |
# To install: | |
# 1. Name this file MyCMSDecorator.php in mysite/code | |
# 2. Requires DataObject::add_extension('LeftAndMain', 'MyCMSDecorator'); | |
# in mysite/_config.php | |
class MyCMSDecorator extends LeftAndMainDecorator { |
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
require 'rubygems' # A script to pull and parse just routedetails | |
require 'jdbc/sqlite3' # Written in jRuby with jdbc-sqlite3 and celerity installed | |
require 'celerity' # Trust me, you'd prefer http://toronto.ca/open to this | |
# I'm using this to test the open dataset given as of Oct 27 | |
# Assuming the following structure for database ... | |
# # DROP TABLE ttcca_routedetails; DROP TABLE ttcca_scheduleitem; DROP TABLE ttcca_routestop; DROP TABLE ttcca_stopdetails; | |
# | |
# sql = <<SQL |
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
/* | |
Auto-Insertion plugin | |
Copyright (c) 2010 Louis St-Amour, but multi-licensed as GPL/LGPL/MPL | |
Embeds: http://code.google.com/p/jquery-oembed/ (MIT License) | |
Plugin for: http://ckeditor.com/license (GPL/LGPL/MPL: http://ckeditor.com/license) | |
*/ | |
(function($) { | |
$.oembedForURL = function(resourceURL, options, callback) { |
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
#include <stdio.h> | |
#include "highgui.h" | |
#include "cv.h" | |
// A quick proof-of-concept by Louis St-Amour to scan for the white bits of waves | |
// in specific video files. Rather slow; each frame takes about 7 seconds (!) | |
// on a Core 2 Duo Unibody MacBook Pro. | |
IplImage* doPyrDown(IplImage* in, int filter) { | |
// Best to make sure input image is divisible by two. |
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
{{define "carousel"}} | |
{{$page := .}} | |
<div class="tabset tabbed_carousel"> | |
<ul class="tabs"> | |
{{range .NewTitleLists}} | |
<li class="tab tab_{{.Index}}"> | |
<a href="{{.Link}}">{{.Title}}</a> | |
</li> | |
{{end}} | |
</ul> |
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
# Assumes the current directory has a file named "Mint Transactions.csv" | |
# downloaded from mint using CSV by hitting "Export" under the per-page settings on | |
# Mint's All Transactions screen. | |
# | |
# This is meant for QuickBooks Online, since the CSV format for Canadians, at least, | |
# doesn't support the 2-column approach used by Mint (first column positive amount, | |
# second column debit/credit indicator) and in QBO, transactions must be imported | |
# one CSV file per account, while it's easier to export all accounts in Mint. | |
# So this script does both conversion to a negative/positive amount and writes CSVs | |
# per account. |
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
void setup() { | |
size(480, 480, P2D); | |
noStroke(); | |
} | |
long i = 0; | |
float x = random(width); | |
float y = random(height); | |
long duration = 10; | |
float prevX = width/2; |
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
PGraphics target; | |
void setup() { | |
size(500, 400); | |
target = createGraphics(width, height); | |
target.beginDraw(); | |
target.background(0); | |
target.stroke(255); | |
target.fill(255); | |
target.ellipse(250, 200, 250, 250); |
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
// Sources: | |
// https://stackoverflow.com/a/64084994 | |
// https://stackoverflow.com/a/25578365 | |
/* Author:Scott Weaver Date:May,2021 */ | |
var emojiPattern = String.raw`(?:\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffc|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffd|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffe|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udfff|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffb|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffd|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffe|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udfff|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c\udffb|\ud83e\uddd1\ud83c\udffd\u200d\u2764\uf |