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
# find who added C# Tests in Test Directories, ordered by date | |
git ls-tree --name-only -z -r HEAD| egrep -i -z -Z -E '(Tests\..*\.*cs)$' | xargs -0 -n1 git blame --show-name -w | grep "\[Test" | grep -v TestFixture | perl -pe 's/^[^\(]+\((\w+\s*\w*)\s+(\d{4}-\d{2}-\d{2}).*/$2 $1/' | sort -n | |
# find who added JS Specs, ordered by date | |
git ls-tree --name-only -z -r HEAD| egrep -i -z -Z -E '(\.spec\.js)$' | xargs -0 -n1 git blame --show-name -w | grep "it\(" | perl -pe 's/^[^\(]+\((\w+\s*\w*)\s+(\d{4}-\d{2}-\d{2}).*/$2 $1/' | sort -n |
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
using System; | |
using System.Text; | |
namespace BridgeCanada.Utils.Csv | |
{ | |
/// <summary> | |
/// Summary description for CsvFormatter. | |
/// </summary> | |
public class CsvFormatter | |
{ |
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 | |
PIDMOTION=$(pgrep -x motion) | |
if [ -n "$PIDMOTION" ] | |
then | |
echo "stopping motion" | |
sudo /etc/init.d/motion stop | |
fi | |
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 | |
find ./ -name '*.jpg' -exec convert -resize 1900x1425 -interlace Plane -quality 50% \{\} ../motion/\{\}.jpg \; |
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 'rspec/core/formatters/progress_formatter' | |
# Example of a formatter with custom bactrace printing. Run me with: | |
# ruby bin/spec xxxxx.rb -r ./test/rspec_formatter_for_emacs.rb -f CustomFormatter | |
class CustomFormatter < RSpec::Core::Formatters::ProgressFormatter | |
def backtrace_line(line) | |
return nil if configuration.cleaned_from_backtrace?(line) | |
str = line.gsub(/([^:]*\.rb):([0-9]+):in /) do | |
path = "#{$1}" | |
lineno = "#{$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
(ns codelesson.assignment-1) | |
;; Write a function called map-while which accepts a function f, a sequence s, and a predicate pred. When applied, it collects the results of applying f to s as long as applying pred to elements returns true. | |
(defn map-while [f s pred] | |
(map f (take-while pred s))) |
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
;; ... Given a bunch of dollar bills, in how many ways can they be broken into coins? | |
;; | |
;; ====================== | |
;; Algorithm | |
;; | |
;; For each coin, calculate a set of multiples from zero to the largest | |
;; number which is less than or equal to the dollar-value goal. Find | |
;; the combinations, choosing one multiple from each set, which total to | |
;; the goal. | |
;; |
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
(ns codelesson.assignment-3) | |
(defn match-element | |
[pattern-el data-el] | |
{:pre [(not (coll? pattern-el)) ] | |
:post [(or (true? %) (false? %))] } | |
(or | |
(= pattern-el data-el) | |
(= '? pattern-el))) |
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 lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
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
(ns codelesson.assignment-4 | |
(:require [clojure.string :as str])) | |
(defn rotate-left [current-dir] | |
{:pre [(char? current-dir)]} | |
((apply hash-map (seq "NWWSSEEN")) current-dir)) | |
(defn rotate-right [current-dir] | |
{:pre [(char? current-dir)]} | |
((apply hash-map (seq "NEESSWWN")) current-dir)) |
OlderNewer