Skip to content

Instantly share code, notes, and snippets.

View trivektor's full-sized avatar
🏠
Working from home

Tri Vuong trivektor

🏠
Working from home
View GitHub Profile
@stelcheck
stelcheck / hbase.rest.scanner.filters.md
Created October 30, 2012 10:00
HBase Stargate REST API Scanner Filter Examples

Stargate Scanner Filter Examples

Introduction

So yeah... no documentation for the HBase REST API in regards to what should a filter look like...

So I installed Eclipse, got the library, and took some time to find some of the (seemingly) most useful filters you could use. I'm very green at anything regarding HBase, and I hope this will help anyone trying to get started with it.

What I discovered is that basically, attributes of the filter object follow the same naming than in the documentation. For this reason, I have made the link clickable and direct them to the HBase Class documentation attached to it; check for the instantiation argument names, and you will have your attribute list (more or less).

@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@aaronsnoswell
aaronsnoswell / gist:3786176
Created September 26, 2012 05:00
Android Webkit <input type="number" /> shim.
// jQuery version
$("input[type='number']").each(function(i, el) {
el.type = "text";
el.onfocus = function(){this.type="number";};
el.onblur = function(){this.type="text";};
});
// Stand-alone version
(function(){ var elms = document.querySelectorAll("input"), i=elms.length;
@hs0ucy
hs0ucy / media-queries-samples.css
Created September 21, 2012 17:48
Media Queries for Standard Devices
/*
* From css-tricks.com
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
@bennadel
bennadel / index.htm
Created September 13, 2012 14:49
Creating AngularJS Controllers With Instance Methods
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>Controllers With Instance Methods In AngularJS</title>
</head>
<body>
<h1>
@LeaVerou
LeaVerou / dabblet.css
Created September 12, 2012 11:58
Fixed width, fluid background
/**
* Fixed width, fluid background
*/
body { margin: 0; font-family: Futura, sans-serif; }
h1 { margin-top: 0 }
section {
width: 700px;
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@santhoshtr
santhoshtr / levenshtein.js
Created August 10, 2012 08:59 — forked from IgorInger/levenshtein.js
Levenshtein distance- Javascript
var levenshteinDistance = function(u, v) {
var m = u.length;
var n = v.length;
var D = [];
for(var i = 0; i <= m; i++) {
D.push([]);
for(var j = 0; j <= n; j++) {
D[i][j] = 0;
}
}
@seanlilmateus
seanlilmateus / gist:3187192
Last active March 5, 2021 07:17
How to use Obj-C with MacRuby/Rubymotion

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
@jjuliano
jjuliano / my_application_controller.rb
Created July 11, 2012 20:37
[Rubymotion] UITableView and UITableViewCell using SimpleView (https://github.com/seanho/SimpleView) taken from Teacup example by Colinta (http://colinta.com/thoughts/aw_hell_its_a_table_cell.html). [refactor to use more SimpleView convention for tagging,
class MyApplicationController < UIViewController
def viewDidLoad
@data = [
{ icon: 'niftywow',
project: 'NiftyWow',
description: "Oh you just can't imagine.",
logos: ['apple', 'github']
},
{ icon: 'amazingwhizbang',