Skip to content

Instantly share code, notes, and snippets.

View newdigate's full-sized avatar

Nic Newdigate newdigate

View GitHub Profile
<project name="YourApp" default="do-build" xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd">
<!-- Version settings -->
<property name="project.config" value="release" />
<property name="project.version.major" value="1" />
<property name="project.version.minor" value="0" />
<property name="project.version.build" value="0" />
<property name="tfs.server" value="http://yourTFSserver:8080/" />
<property name="tfs.fullpath" value="$/yourTeamProject/someDirectory/andSoOn/" />
<property name="company" value="${project::get-name()}"/>
<property name="project" value="${project::get-name()}"/>
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@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.
@royvandam
royvandam / CMakeLists.txt
Created July 2, 2012 14:11
Adds an uninstall target to the CMAKE generated Makefile.
##
# Add uninstall target
# Requirements: Copy the uninstall.cmake file to the appropriate CMAKE_MODULE_PATH.
#
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake"
)
@voising
voising / gists_to_dash_db.rb
Last active October 21, 2021 21:32
Connect Gists with Dash (Code Snippet Manager)
#!/usr/bin/env ruby
if ARGV[0].nil? || ARGV[0].match(/-h/)
puts "Usage : #{$0} github_username dash_sqlite_db char_appended_to_keyword [no_comments]"
exit
end
require 'net/http'
require 'open-uri'
#require 'awesome_print'
@dergachev
dergachev / squid-deb-proxy_on_docker.md
Last active May 25, 2023 03:55
Caching debian package installation with docker

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@staltz
staltz / introrx.md
Last active July 26, 2024 04:24
The introduction to Reactive Programming you've been missing
@domenic
domenic / v8-versions.md
Last active December 11, 2020 01:45
V8 versions for embedders

Embedders of V8 should generally use the head of the branch corresponding to the minor version of V8 that ships in Chrome.

Finding the minor version of V8 corresponding to the latest stable Chrome

To find out what version this is,

  1. Go to https://omahaproxy.appspot.com/
  2. Find the latest stable Chrome version in the table
  3. Enter it into the "Translate a Chrome verison to a V8 version" box below the table.
  4. Ignore the last two parts.
@newdigate
newdigate / gist:b2f2d3c96daf0ab26260
Last active August 29, 2015 14:21
SQLServer Dynamic Revision Table DDL Generator
CREATE FUNCTION dbo.genRevTableColumnsDDL( @TableName AS VARCHAR(40) ) RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @sql NVARCHAR(MAX) = N'';
SELECT @sql += CASE
WHEN column_ordinal = 1 AND UPPER(name) = 'ID' THEN
CHAR(9) + '[ID]'+ CHAR(9) + 'BIGINT' + CHAR(9) + 'NOT NULL PRIMARY KEY IDENTITY,' + CHAR(13) + CHAR(10) +
CHAR(9) + '['+@TableName+'ID]'+ CHAR(9) + 'BIGINT' + CHAR(9) + 'NOT NULL,' + CHAR(13) + CHAR(10)
ELSE
CHAR(9) + '[' + name + '] ' + system_type_name + ' NULL,'+ CHAR(13) + CHAR(10)