Skip to content

Instantly share code, notes, and snippets.

View chrislovecnm's full-sized avatar
😃
Living LIFE!!

Chris Love chrislovecnm

😃
Living LIFE!!
View GitHub Profile
@chrislovecnm
chrislovecnm / gist:1338247
Created November 3, 2011 23:24
Git goodness
git pull -s recursive -X theirs
@chrislovecnm
chrislovecnm / gist:1349373
Created November 8, 2011 21:52
Mvn build release instructs from dsyer ~ ampq spring

Requirements:

  • Java 6;
  • Maven 2.2.1
  • (Optional) Ant 1.7.1;
  • If you are on Linux don't use Maven or Ant installed by root (file permission issues with mvn deploy - download it and install it as yourself).

Tagging

@chrislovecnm
chrislovecnm / gist:1359965
Created November 12, 2011 02:59
jquery validation plugin fix
var v = $.browser.msie && !(op.attributes['value'] != null &&
op.attributes['value'].specified) ? op.text : op.value;
// var v = $.browser.msie && !(op.attributes['value'].specified) ?
op.text : op.value;
@chrislovecnm
chrislovecnm / gist:1375751
Created November 18, 2011 06:18
Evil ie dropdowns
function selectDropDownIEbehavior() {
// Apply this behavior for IE only
if (!$.browser.msie)
return;
var expand = function()
{
var width = $(this).css("width");
// Don't overwrite the stored original width,
@chrislovecnm
chrislovecnm / gist:1525241
Created December 27, 2011 21:37
Git Cheat Sheet

Git overview / cheat sheet

Some common commands that are used with git

  • init
  • log
  • rebase - like a merge (change the order of commits)
  • merge
  • commit
@chrislovecnm
chrislovecnm / gist:2322545
Created April 6, 2012 19:58
Backups Redis and Cassandra
- redis-cli BGSAVE
- on each cassandra node nodetool -h localhost -p 7199 snapshot snapshot-name
// taken from http://snes9x-rr.googlecode.com/svn/trunk/snes9x-151/lua-engine.cpp
// http://snes9x-rr.googlecode.com/svn/trunk/snes9x-151/SFMT/SFMT.c
// same as math.random, but uses SFMT instead of C rand()
// FIXME: this function doesn't care multi-instance,
// original math.random either though (Lua 5.1)
static int sfmt_random (lua_State *L) {
lua_Number r = (lua_Number) genrand_real2();
switch (lua_gettop(L)) { // check number of arguments
case 0: { // no arguments
@chrislovecnm
chrislovecnm / gist:4464615
Created January 6, 2013 01:06
Image scaling
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/#solve
https://github.com/thebuzzmedia/imgscalr
http://stackoverflow.com/questions/10245220/java-image-resize-maintain-aspect-ratio
@chrislovecnm
chrislovecnm / iGivefirst API Draft
Created March 13, 2013 15:38
iGivefirst API Draft
#iGivefirst API
This api allows iGivefirst partners to show nonprofit advertisements on their websites and collect donations on behalf of iGivefirst, and nonprofits.
## General Concepts
### Guids
Our API utizes business keys in the form of standard 36 character guids. These guids are created with-in our system and are unique. The main guids that are utilized: