Skip to content

Instantly share code, notes, and snippets.

View bardware's full-sized avatar

Bernhard Döbler bardware

View GitHub Profile
@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Custom Error Objects in JavaScript</title>
</head>
<body>
<h1>Custom Error Objects in JavaScript</h1>
@mhayes
mhayes / dsn-listing.cfm
Created January 3, 2011 15:47
List DSN's that exist on a particular server
<h2>Server: <cfoutput>#CGI.SERVER_NAME#</cfoutput></h2>
<p>
The following ColdFusion DSN's are available on this server:
</p>
<cfscript>
// Instantiate CF Admin API
adminObj = createObject("component","cfide.adminapi.administrator");
@gbakernet
gbakernet / sassmacros.xml
Created May 18, 2012 08:33
Sass Macros for Ant
<?xml version="1.0"?>
<!--
# Sass Macros for Ant
# http://github.com/gbakernet
# Authored 2012 Glenn Baker; Licensed MIT */
<sass> Usage - Compile sass files
* jarpath - is path to jruby-complete.jar and gem-sass.jar
* src - input
* dest - output
@alwalker
alwalker / FlacMp3.ps1
Last active December 23, 2023 18:45
Convert a folder of flac files to 192k variable bit rate mp3's. Takes Artist, Album, Track #, Title, Genre, Date, and Album Art tags with it.
$files = get-childitem F:\Work_Area\Music\Raw *.flac -rec
foreach ($file in $files)
{
$artist = metaflac $file.fullname --show-tag=ARTIST
$artist = $artist.split("=")[1]
$title = metaflac $file.fullname --show-tag=TITLE
$title = $title.split("=")[1]
$album = metaflac $file.fullname --show-tag=ALBUM
$album = $album.split("=")[1]
@coolya
coolya / gist:3551118
Created August 31, 2012 10:13
EnumerableExtensions.cs
public static class EnumerableExtensions
{
public static BlockingCollection<T> CopyToBlockingCollectionAsync<T>(this IEnumerable<T> source)
{
var collection = new BlockingCollection<T>();
Task.Factory.StartNew(() =>
{
foreach (var item in source)
{
@lukearmstrong
lukearmstrong / build.xml
Created November 19, 2012 11:07
Ant build script for SASS
<?xml version="1.0" ?>
<project default="default" basedir=".">
<target name="default" depends="load.properties, sass" />
<target name="load.properties">
<echo>-- Initialize Variables</echo>
<!-- Hopefully the line below is the only one you need to change -->
<property name="template.path" value="public/assets/templates/PUT-YOUR-TEMPLATE-FOLDER-NAME-HERE" />
@coldfumonkeh
coldfumonkeh / twitterdateformat.cfm
Created December 19, 2012 22:40
Handling Twitter's "interesting" date format in ColdFusion
<cffunction name="parseTwitterDateFormat" output="false" returntype="String" hint="I return the date in a useable date format.">
<cfargument name="twitterDate" required="true" type="string" hint="The Twitter date." />
<cfset var formatter = CreateObject("java", "java.text.SimpleDateFormat").init("EEE MMM d kk:mm:ss Z yyyy") />
<cfset formatter.setLenient(true) />
<cfreturn formatter.parse(arguments.twitterDate) />
</cffunction>
@jasdeepkhalsa
jasdeepkhalsa / build.xml
Created January 10, 2013 16:47
Sample Ant build.xml file for concat and minifying CSS & JS files by Addy Osmani
<?xml version="1.0" encoding="utf-8"?>
<project name="tutorialProject" default="prod" basedir="/Users/addy/buildTut/">
<description>Client-side ANT build file example</description>
<target name="-load.properties"
description="Set properties for this build">
<!--YUI Compressor location-->
<property name="yui.dir" value="${basedir}/yuicompressor/build/yuicompressor-2.4.2.jar"/>
<!--Source JS dir-->
@kvnsmth
kvnsmth / example-subtree-usage.md
Last active March 5, 2023 21:58
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.