Skip to content

Instantly share code, notes, and snippets.

View JamesMaroney's full-sized avatar

James Maroney JamesMaroney

View GitHub Profile
'shared/dialog/dialog_view_host': isolate.mapAsFactory (actualDialog, dialogViewName, requestingModule)->
rendermakeSpy = makeSpy 'Isolated Dialog Render'
closeDialog = makeSpy 'Isolated Dialog Close'
fakeDialog = (makeSpy 'Isolated Dialog Initializer').andCall (viewRenderer)->
try
glee.DONT_CALL_INITIALIZE = true
viewRenderer jQuery('<div />'), closeDialog
catch ex
requestingModule = requestingModule.replace(/.*\//,'')
task :default do
source = File.open('source.xml').read
source.scan(/id="(.*?)".*?d="(.*?)"/m) do |m|
puts "id: #{m[0]}, path: #{m[1]}"
File.open("#{m[0]}.svg", "w+") do |out|
out.write '<svg>'
out.write "<path d=\"#{}\""
out.write '</svg>'
end
end
let s:current_path=expand("<sfile>:h")
fun! DebugAllTestsInScreen()
echo system("screen -S spec_suite -p 0 -X stuff 'shopt -s globstar nullglob\n export PS1=\n cd " . getcwd() . "\nclear\n rake test debug=yes reporter=spec \n'")
endfun
fun! DebugLocalTestsInScreen()
echo system("screen -S specs -p 0 -X stuff 'shopt -s globstar nullglob\n export PS1=\n cd " . getcwd() . "\nclear\n rake test debug=yes reporter=spec " . expand("%:p:h") . "/*.spec.coffee " . expand("%:p:h") . "/*.spec*/**/*.spec.coffee\n'")
endfun
<script type="text/javascript" src="require.js"></script><!-- sub: require.js => ~/require.js -->
<script type="text/javascript" src="require.js"></script><!-- gsub!(/require.js/, '~/require.js') -->
function! CoffeeClean()
let save_cursor = getpos(".")
"general puncuation spacing cleanup
"
"Missing spaces
silent! %s/\v','/', '/g
silent! %s/\v","/", "/g
silent! %s/\v:(\w)(['"].*)@<!/: \1/g
silent! %s/\v:\@(['"].*)@<!/: @/g
"lambdas
"
"always remove a space before the rocket
silent! %s/)\s+->/)->/g
silent! %s/)\s+=>/)=>/g
silent! %s/,\s*->/, ->/g
silent! %s/,\s*=>/, =>/g
function getConfigVal(key, defaultValue){
if(localStorage.getItem('fixtureMode') !== true) return defaultValue;
var localStorageValue = localStorage.getItem(key);
return localStorageValue === null ? defaultValue : localStorageValue;
}
Hello Randall and Toby,
My coworkers and I are interested in hosting atl js at our workplace, The Network, if you're still looking for a home. We have started the process of getting oks from the right folks here and that is going really well.
As for us, we're a fun group of 4 guys that are building a suite of products based on a thin-server, thick-client architecture heavily utilizing tools like coffeescript, jasmine, underscore and backbone. We are very interested in becoming active members of the Atlanta javascript community.
We would be super excited to host and attend events, provide refreshments, learn from you guys and share our learnings too.
Let us know if you guys are interested in talking sometime.
You can reach me by email: james.maroney@gmail.com or phone 404.290.8583
@JamesMaroney
JamesMaroney / gist:1401690
Created November 28, 2011 19:39
Guid Combine
public static Guid Combine(params Guid[] guids) {
const int BYTECOUNT = 16;
byte[] destByte = new byte[BYTECOUNT];
var listOfByteArrays = guids.Select(guid => guid.ToByteArray()).ToArray();
for (int i = 0; i < BYTECOUNT; i++) {
destByte[i] = listOfByteArrays.Aggregate<byte[], byte>(0, (current, array) => (byte) (current ^ array[i]));
}
return new Guid(destByte);
}
@JamesMaroney
JamesMaroney / gist:1367121
Created November 15, 2011 13:54
Serializer
public static class Serializer
{
private static JsonSerializer ServerToServerInstanceBacker;
private static JsonSerializer ServerToClientBacker;
private static JsonSerializer ClientToServerBacker;
public static JsonSerializer ServerToServerInstance { get { return ServerToServerInstanceBacker = ServerToServerInstanceBacker ?? Get(); } }
public static JsonSerializer ServerToClientInstance {