Skip to content

Instantly share code, notes, and snippets.

View azz's full-sized avatar
🍣
和食が恋しいよ

Lucas Azzola azz

🍣
和食が恋しいよ
View GitHub Profile
@azz
azz / lucas.py
Last active August 29, 2015 14:04
Prints the first 10 Lucas Numbers
print "━".join([reduce(lambda x,n: [x[1], x[0]+x[1]], range(i), [2,1])[0] *'┃' for i in range(10)])
#include <iostream>
using namespace std;
int main() {
int sz;
cout << "enter size: ";
cin >> sz;
int* x = new int[sz];
cout << "allocated " << (sz * sizeof(int)) << " bytes at " << x << endl;
delete [] x;
@azz
azz / JS-Matrix-Constructors.js
Created September 17, 2012 13:49
JS Matrix Constructors
// [Not sure how to implement multiple constructors for the same object using a psuedo-static method
// (hence return this)... FIXME if incorrect.
/**
* Construct a 2 dimensional rotation matrix about the point (0,0)
* @param {Number} theta the angle to rotate
*/
function Matrix.create2DRotation(theta) {
this.columnns = this.rows = 2;
var sinTheta = Math.sin(theta);
@azz
azz / Procedure-CLEANOUT.sql
Created October 24, 2012 10:52
Procedure "CLEANOUT"
CREATE OR REPLACE PROCEDURE "CLEANOUT" AS
-- Drop FK restraints (type = ''R') so tables can be dropped in any order
cursor con_cursor IS
SELECT rtrim(constraint_name) as conname, rtrim(table_name) as tabname
FROM user_constraints
WHERE rtrim(constraint_type) = 'R';
-- Leave some objects to prevent problems when objects are dropped out of order
-- Do not drop indexes, they will go with tables
@azz
azz / facebook-tweaks.css
Created October 25, 2012 06:36
Facebook CSS Tweaks
/*
* NB: This is quite buggy as FB are still changing things
* every 5 minutes...
*/
@-moz-document domain("facebook.com") {
#rightCol{
display: none;
}
@azz
azz / gist:5660061
Created May 28, 2013 01:52
IT DUN GOOF'd
05-28 11:48:48.238: ERROR/AndroidRuntime(3954): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{edu.monash.laazz1_jmpan5.app/edu.monash.laazz1_jmpan5.app.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "edu.monash.laazz1_jmpan5.app.MainActivity" on path: /data/app/edu.monash.laazz1_jmpan5.app-2.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
#!/bin/bash
echo "joining files $1 and $2 ..."
name=$( echo "$1" | sed 's/\ \(Part [0-9]\)//' | sed 's/\ \[[0-9]of[0-9]\]//' )
avidemux --nogui --load "$1" --append "$2" --save "$name"
echo "saved as $name"
@azz
azz / colors.js
Created October 28, 2013 08:41
Color keywords. Extracted from jqPlot, Copyright (c) 2009-2011 Chris Leonello.
var colorKeywordMap = {
aliceblue: 'rgb(240, 248, 255)',
antiquewhite: 'rgb(250, 235, 215)',
aqua: 'rgb( 0, 255, 255)',
aquamarine: 'rgb(127, 255, 212)',
azure: 'rgb(240, 255, 255)',
beige: 'rgb(245, 245, 220)',
bisque: 'rgb(255, 228, 196)',
black: 'rgb( 0, 0, 0)',
blanchedalmond: 'rgb(255, 235, 205)',
@azz
azz / bjqs-1.3-modified.js
Last active December 28, 2015 18:38
Modified "Basic jQuery Slider" to add an active class to the current `li` tag.
/*
* Basic jQuery Slider plug-in v.1.3
*
* http://www.basic-slider.com
*
* Authored by John Cobb
* http://www.johncobb.name
* @john0514
*
* Copyright 2011, John Cobb
@azz
azz / tests.ts
Last active February 7, 2016 23:57
Typescript Test Runner
class TestUtils {
// A factory function
static makeTestDecorator(prop: string, modifierFn?: (...fnArgs) => any) {
// Apply modifierFn if it exists, and
// Flatten single-element arrays to a value
const handle = (...values) => {
if (modifierFn)
return modifierFn(...values);
if (values.length === 1)
return values[0];