Skip to content

Instantly share code, notes, and snippets.

@luckyllama
luckyllama / twitter-helper.js
Created April 5, 2015 07:19
A twitter api javascript helper to markup a tweet's text with twitter api "entities" anchor tags.
window.TwitterHelper = (function ($, _) {
"use strict";
/* created by frank hadder
* requires lodash/underscore and jQuery
* This helper class will convert a text tweet from twitter's api to html markup--converting url,
* hashtag, and user "entities" into anchor tags.
*/
var forceArray = function (obj) {
// the entity objects are regular objects when count = 1 and arrays when count > 1, here we force an array
@luckyllama
luckyllama / shortcut.js
Created September 9, 2014 21:36
TweetDeck Ctrl + C clear shortcut
var ctrlc = function (callback) {
var isCtrl = false;
$(document).off(".ctrlc");
$(document).on("keydown.ctrlc", function(e) {
if (e.ctrlKey) { isCtrl = true; }
if (e.which === "C".charCodeAt(0) && isCtrl) {
callback();
return false;
}
}).on("keyup.ctrlc", function(e) {
@luckyllama
luckyllama / index.html
Last active August 29, 2015 14:00
test
<div id="test">
THIS IS A TEST
</div>
<div id="coffee">
<script type="text/coffeescript">
$("#test").append "<p>test coffee</p>"
console.log "test coffee ran"
</script>
</div>

View the Spotify Playlist

Shortlist of my Favorites

Piano

  • Nocturne No. 13 in Cm, Op. 48 no. 1 by Frederic Chopin - Chopin once was quoted, "Why do we live on through this wretched life which only devours us and serves to turn us into corpses? [...] It is therefore right of me to be angry that I was ever born into this world!" but generally his music is a little less depressing.
  • Nocturne No. 2 in Ebm Op. 9 no. 2 by Frederic Chopin
  • Prelude #4 in Em Op.28 no. 4 by Frederic Chopin - my music-to-art generater created this based on this piece
  • Prelude #15 in Db Op.28 no. 15 "Raindrop" by Frederic Chopin
using System;
using System.Diagnostics;
using System.Linq.Expressions;
namespace Luckyllama.Helpers {
public static class Check {
public static class Argument {
[DebuggerStepThrough]
public static void Is(Expression<Func<bool>> expression, string errorMessage = "is invalid.") {
@luckyllama
luckyllama / gist:3805441
Created September 29, 2012 23:56
Running Fubot Locally
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
export HUBOT_IRC_SERVER="irc.freenode.net"
export HUBOT_IRC_ROOMS="#fubot-test"
export HUBOT_IRC_NICK="fubot-test"
node_modules/.bin/hubot -a irc -n fubot-test
@luckyllama
luckyllama / example.sh
Created July 13, 2012 20:56
The Git-CompareBranchesMerged Cmdlet
# Assume we have a QA branch and a master (production) branch.
# The following feature branches have been merged with QA: A, B, C, D, E, F
# The following feature branches have been merged with master: A, B, C
PS> gcbm QA master
Listing branches in QA which are not in master
-> D
-> E
-> F
PS>
using Intermark.Tam.Data.Contracts.Exceptions;
namespace Intermark.Tam.Data.Dependency
{
public static class DatabaseExceptionHelper
{
/// <exception cref="DuplicateRecordDatabaseError"><c>DuplicateRecordDatabaseError</c>.</exception>
/// <exception cref="UpdatedRecordNotExistDatabaseError"><c>UpdatedRecordNotExistDatabaseError</c>.</exception>
/// <exception cref="InvalidLanguageTokenDatabaseError"><c>InvalidLanguageTokenDatabaseError</c>.</exception>
/// <exception cref="InvalidAssetTypeDatabaseError"><c>InvalidAssetTypeDatabaseError</c>.</exception>
@luckyllama
luckyllama / ExampleUsage.cs
Created January 19, 2012 00:10
Lamda Comparers
var set = new List<dynamic>();
var comparer = new LamdaEqualityComparer<dynamic>((obj1, obj2) => obj1.Id == obj2.Id, obj => obj.GetHashCode());
var results = set.Distinct(comparer);