Skip to content

Instantly share code, notes, and snippets.

@l4u
l4u / pastie.rb
Created March 5, 2012 03:45 — forked from rriemann/pastie.rb
Paste script to paste to pastie.org from command line. Written in ruby
#!/usr/bin/env ruby
# kate: remove-trailing-space on; replace-trailing-space-save on; indent-width 2; indent-mode ruby; syntax ruby;
require 'net/http'
require 'optparse'
require 'timeout'
require 'cgi'
require 'uri'
class Hash
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Draggable + Sortable</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script>
<script src="jquery.ui.touch-punch.js"></script>
@l4u
l4u / gist:2015228
Created March 11, 2012 06:07
useful vim wrap lines
gqgq (wrap the current line)
gq{ (wrap this paragraph, i.e. until the next blank line)
@l4u
l4u / gist:2022221
Created March 12, 2012 14:19
Create active_admin user
AdminUser.create! :email => "[email protected]", :password=>"password"
@l4u
l4u / gist:2048562
Created March 16, 2012 04:56
cocos2d-x git tag sorting
git tag -l | sort -n -t. -k4,4 -k5,5 -k6,6
@l4u
l4u / gist:2145807
Created March 21, 2012 09:31
engine initialization in OpenSSL
// http://stackoverflow.com/questions/242665/understanding-engine-initialization-in-openssl
unsigned char* key = (unsigned char*) "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
unsigned char* data = (unsigned char*) "\x48\x69\x20\x54\x68\x65\x72\x65";
unsigned char* expected = (unsigned char*) "\x49\x2c\xe0\x20\xfe\x25\x34\xa5\x78\x9d\xc3\x84\x88\x06\xc7\x8f\x4f\x67\x11\x39\x7f\x08\xe7\xe7\xa1\x2c\xa5\xa4\x48\x3c\x8a\xa6";
HMAC_CTX ctx;
unsigned char* result;
unsigned int result_len = 32;
int i;
@l4u
l4u / gist:2204522
Created March 26, 2012 11:30
Add print.css to rails asset precompile
46 config.assets.precompile += %w( print.css )
@l4u
l4u / gist:2232378
Created March 29, 2012 01:51
Checking out cocos2d-x 0.13.0-beta
git pull upstream master --tags
git checkout cocos2d-1.0.1-x-0.13.0-beta
@l4u
l4u / gist:2233073
Created March 29, 2012 03:43
Layer Clipping cocos2d-x
//http://codewars.net/304/layer-clipping-in-cocos2d-x/
void CCClippingLayer::visit()
{
// quick return if not visible
if (!getIsVisible())
{
return;
}
@l4u
l4u / gist:2239568
Created March 29, 2012 16:35
Maya Mac OS X plugin path
Users/Shared/Autodesk/maya/plug-ins