Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Working from home forevah!

Mark Sta Ana booyaa

🏠
Working from home forevah!
View GitHub Profile
@booyaa
booyaa / ReplaceOldValue.sql
Created January 10, 2014 12:37
SQL: How to replace an old id with new value
/*
Assume you have a value in a table that looks like this:
select foo from bar
|foo |
|uspFTW 123|
You want to change 123 to 929
*/
@booyaa
booyaa / HAXMAS.ino
Created December 18, 2013 21:06
Colchester HackSpace (@ColchHackSpace) HAXMAS challenge
/*
Colchester HackSpace (@ColchHackSpace) HAXMAS!!!
heavily based on blink
tunes provided by https://gist.github.com/elubow/7844436
/This/ example code is in the public domain.
Power to v3.3
@booyaa
booyaa / vs-postbuild.bat
Created December 11, 2013 09:58
Useful Visual Studio post-build script, tested against VS2010. Largely inspired by Thompson Reuters RFA example solutions and SS64 FC page.
ECHO OFF
::everyone loves metrics!
ECHO Start: %TIME%
ECHO Copying common config files
::testing if config file has ever been copied to release folder
IF NOT EXIST "$(TargetDir)settings.cfg" GOTO copyFile
::testing if config file has been updated
FC "$(ProjectDir)\settings.cfg" "$(TargetDir)settings.cfg" | FIND "FC: no dif" > NUL
@booyaa
booyaa / voting-2012.txt
Created December 11, 2013 08:00
voting for london hackspace trustees elections 2012
grep -iE '(robonaut|jonty|russs)' *-hack-space.12*.log | grep -i votes | grep -i '@russs'
#london-hack-space.12-06.log:10:57 <@russss> 3 votes so far :/
#london-hack-space.12-06.log:10:58 <@russss> we need 183 votes to be quorate. Might be a tough one
#london-hack-space.12-06.log:11:07 <@russss> 16 votes
#london-hack-space.12-06.log:11:42 <@russss> we've got 50 votes now
#london-hack-space.12-06.log:13:04 <@russss> 73 votes
#london-hack-space.12-06.log:16:10 <@russss> 93 votes so far
#london-hack-space.12-06.log:18:16 <@russss> 103 votes
#london-hack-space.12-06.log:18:57 <@russss> http://en.wikipedia.org/wiki/Counting_Single_Transferable_Votes
@booyaa
booyaa / JavascriptOneliners.md
Created October 22, 2013 10:26
javascript oneliners
@booyaa
booyaa / dosBatchMagick.md
Last active December 26, 2015 04:59
dos batch magick

#ERROR redirection

:: redirect stderr to nul
dir *.csv 2> NUL

:: in a batch file for loop, you may need to escape the char
for /f "delims=" %%x in ('dir *.csv 2^> NUL') do @echo %xx
@booyaa
booyaa / linqmagick.md
Created October 7, 2013 14:33
LINQmagick

Convert DataTable into a Dictionary

let's assume your dt looks like

|key |value|
|----------|
|your|mum  |

@booyaa
booyaa / CSharpChunkaString.md
Created October 7, 2013 11:00
C# Chunk a String

#split string into an array of strings

source: http://stackoverflow.com/a/3008775/105282

namespace StringChunks
{
    static class Tools
    {
        public static IEnumerable<string> SplitByLength(this string str, int maxLength)
@booyaa
booyaa / ListOfLists.md
Created October 4, 2013 14:21
C# List of Lists

Don't forget to add the following referencs to your query if using LINQPad:

System.Collections
System.Data.OleDb
System.Data.SqlClient
System.Xml
System.Xml.XPath