Skip to content

Instantly share code, notes, and snippets.

View nausik's full-sized avatar
🐈
Kotik

Artem Barbyniahra nausik

🐈
Kotik
View GitHub Profile
@nausik
nausik / link_to.rb
Created March 3, 2012 12:31 — forked from j-wilkins/link_to.rb
A link_to helper method for Sinatra
@nausik
nausik / promises_timeout
Last active August 29, 2015 14:16
Fun stuff with promises
<html>
<body ng-app = "testapp">
<div id ng-controller = "TestController as test"></div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="angular.min.js"></script>
<script>
var app = angular.module('testapp', []);
app.controller('TestController', ['WatFactory', function(wat){
var func = function func(){
console.log("2");
}
function func(){
console.log("1");
}
func();
@nausik
nausik / gist:ad9d20edd185af6b6777
Created March 1, 2015 16:46
Private object var
var obj = {
one: "wat",
two: "wut"
};
function addPrivateVar(o, name, val) {
obj[name] = (function() {
var inner_val = val;
class Db
include Singleton
attr_accessor :db
def initialize
@db = SQLite3::Database.new "runcommend.sqlite3"
@db.results_as_hash = true
end
end