Skip to content

Instantly share code, notes, and snippets.

View bitliner's full-sized avatar

Giovanni Gaglione bitliner

View GitHub Profile
@bitliner
bitliner / person.ajs
Created February 10, 2014 05:55 — forked from tj/person.ajs
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@bitliner
bitliner / unsafe.js
Created October 22, 2014 12:58
angularjs filter unsafe html
'use strict';
angular.module('unsafe')
.filter('unsafe', function($sce) {
return function(input) {
return $sce.trustAsHtml(input);
};
});
@bitliner
bitliner / git-post-receive
Created November 11, 2014 16:12
bash script /hooks/post-receive for running a Node.js script just after it has been pushed to a remote repository
#!/bin/bash
PROJECT_FOLDER=$HOME/< path to project >
PATH=< path to nodejs >:$PATH
GIT_WORK_TREE=$PROJECT_FOLDER git checkout -f
cd $PROJECT_FOLDER
<html>
<head>
<title></title>
<style type="text/css">
* {
box-sizing: border-box;
}
body {
margin: 0;
@bitliner
bitliner / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bitliner
bitliner / create_unique_id.js
Created September 22, 2015 20:12
create unique id in javascript
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
noop:
publish_patch:
npm version patch && git push --all origin && git push --tags && npm publish
publish_minor:
npm version minor && git push --all origin && git push --tags && npm publish
publish_major:
npm version major && git push --all origin && git push --tags && npm publish
# https://github.com/docker/toolbox/issues/453
docker-machine rm default
docker-machine create default --driver virtualbox