Skip to content

Instantly share code, notes, and snippets.

View forabi's full-sized avatar
🎯
Focusing

M-Fawaz Orabi forabi

🎯
Focusing
View GitHub Profile
@forabi
forabi / stat.sh
Created September 26, 2014 17:11
Statistics for Node/CoffeeScript projects
#!/bin/bash
function get_file_names {
find -type f |
egrep -v '/(node_modules)|(.git)/' | # Ignore node_modules and .git
egrep -v '^./(tmp|posts|dist)/' | # Ignored dirs
egrep -v '.(swp|ttf|txt|css|woff|eot|svg|png|jpe?g|sublime-.*)$' # Ignored file types
}
function get_loc {
@forabi
forabi / primes.js
Last active August 29, 2015 14:03
ECMAScript 6 implementation of Sieve of Eratosthenes algorithm https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
'use strict';
function* getPrimes(n) {
let compos = [];
for (let i = 2; i <= n; i++) {
if (compos[i]) continue;
yield i;
for (let j = i * 2; j <= n; j += i) {
compos[j] = true;
}
}
app = angular.module "ng-blog", []
app.controller 'HomeCtrl', ($http, $scope) ->
$scope.posts = [
(
title: "Hello world!",
excerpt: "A simple Hello World!"
)
(
title: "Hello world!",
excerpt: "A simple Hello World!"