Skip to content

Instantly share code, notes, and snippets.

@edeustace
edeustace / update-monitor-position
Created September 25, 2018 09:39
update-monitor-position for monitors.xml version 2
#!/bin/bash
# -------------------------------------------------
# Get monitors configuration from monitor.xml and apply it for current user session.
# In case of multiple definitions in monitor.xml only first one is used.
#
# See http://bernaerts.dyndns.org/linux/74-ubuntu/309-ubuntu-dual-display-monitor-position-lost
# for instructions
#
# Revision history :
# 19/04/2014, V1.0 - Creation by N. Bernaerts
@edeustace
edeustace / download_zip.ps1
Created May 15, 2012 08:47
powershell script to download zip and copy items from the zip to locations on destination file
# copy items
# if you have a zip here: http://myserver.com/my.zip and it contains myFile.txt and myFolder/myOtherFile.txt
# you can call this script like so:
# .\download_zip.ps1 http://myserver.com/my.zip "myFile.txt|c:\myFileDestination\myFileHere.txt" "myFolder/myOtherFile.txt|c:\myOtherDestination\myOtherFile.txt"
#
"download script -----------------------------------------"
"------"
"Downloads from the given url, unzips it then for each string arg, copies the file to the destination"
@edeustace
edeustace / ItemTransformer.scala
Created January 10, 2014 15:24
A simple json transformer based on play-json transforms
package org.corespring.platform.json.transformers
object ItemTransformer extends JsonTransformer(
"taskInfo.title" -> "title",
"taskInfo.subjects.primary" -> "primarySubject",
"taskInfo.subjects.related" -> "relatedSubject",
"taskInfo.itemType" -> "itemType",
"taskInfo.gradeLevel" -> "gradeLevel",
"otherAlignments.keySkills" -> "keySkills",
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
@edeustace
edeustace / sp.AutoGenerateAuditTableAndTrigger.sql
Created April 13, 2012 15:01
A stored procedure for sqlserver 2008 to generate history tables and triggers
/************************************************************************************************************
Inspired by: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84331
Created By: Bryan Massey
Created On: 3/11/2007
Comments: Stored proc performs the following actions:
1) Queries system tables to retrieve table schema for @TableName parameter
2) Creates a History table ( @TableName + '_History') to mimic the original table, plus include
additional history columns.
3) If @CreateTrigger = 'Y' then it creates an Update/Delete trigger on the @TableName table,
which is used to populate the History table.
@edeustace
edeustace / git_status.sh
Created May 17, 2012 11:05
copy modified files from git status to a location
gst | grep modified | awk '{print $3}' | xargs -I {} cp {} ~/my_destination
@edeustace
edeustace / demo-player-w-config-panel.html
Last active March 20, 2018 17:52
demo-player using assets generated using `pie pack`
<!doctype html>
<html>
<head>
<title>Demo</title>
<style>
body {
font-family: 'Roboto', sans-serif;
}
@edeustace
edeustace / Function.bind.polyfill.js
Created December 4, 2013 12:29
A polyfill for function.bind for IE8
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},