Skip to content

Instantly share code, notes, and snippets.

View maggiben's full-sized avatar

Benjamin maggiben

  • Frávega
  • Argentina
View GitHub Profile
<!DOCTYPE html>
<meta charset="utf-8">
<title>Crossfilter</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<style>
body {
font-family: arial;
}
.main {
position: relative;
@maggiben
maggiben / _.md
Created January 30, 2014 21:54
switch
This file has been truncated, but you can view the full file.
# BLOCK COUNTRY BY IP RANGE
# IncrediBILL's HTACCESS Tools
# http://incredibill.me
<Limit GET POST HEAD>
order allow,deny
#
# Block from AFGHANISTAN (AF)
#
deny from 27.116.56.0/22
deny from 58.147.128.0/19
{
"data":
[
{
"name": "Cámara de Diputados - H. Congreso de la Unión",
"profile_url": "https://facebook.com/213693228664478",
"profile_img": "http://graph.facebook.com/213693228664478/picture?type=large",
"last_update": "2014-03-28 16:06:29",
"comment_count": 64
},
@maggiben
maggiben / .jshintrc
Last active August 29, 2015 13:57
ang-bp
{
"strict": true,
"undef": true,
"unused": true,
"node": true,
"globals": {
"describe": true,
"it": true,
"beforeEach": true,
"afterEach": true
@maggiben
maggiben / mapreduce.js
Created April 3, 2014 21:18
MongoDB Map Reduce for LOG table
///////////////////////////////////////////////////////////////////////////////
// Shema //
///////////////////////////////////////////////////////////////////////////////
var Logs = new Schema({
ip: { type: String, required: true, trim: true },
query: {type: Object},
requestHeaders: {type: Object},
requestBody: {type: Object},
responseHeaders: {type: Object},
responseBody: {type: Object},
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
<div class="container" style="height: 116px; line-height: 116px;">
<strong class="logo"><a href="http://www.linkedmediagroup.com/"><img src="http://www.linkedmediagroup.com/wp-content/uploads/2013/04/space-rocket5b1.png" alt="Linked Media Group" scale="0"></a></strong><div class="main_menu" data-selectname="Select a page"><div class="menu-main-menu-container"><ul id="menu-main-menu" class="menu" style="display: none;"><li id="menu-item-6342" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="http://www.linkedmediagroup.com/" style="height: 116px; line-height: 116px;"><span class="avia-bullet"></span>Home<span class="avia-menu-fx"><span class="avia-arrow-wrap"><span class="avia-arrow"></span></span></span></a></li>
<li id="menu-item-6343" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-mega-parent "><a href="http://www.linkedmediagroup.com/about-us/" style="height: 116px; line-height: 116px;"><span class="avia-bullet"></span>About Us<span class="avia-m
@maggiben
maggiben / camelcase.js
Created May 24, 2014 02:02
spaces to camel case
"my product name".replace(/\s+/g,'-').toLowerCase().replace(/-(.)/g, function(match, group1) {
return group1.toUpperCase();
});
// ---> myProductName
@maggiben
maggiben / stage.js
Last active August 29, 2015 14:02
d3 & angular
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8"></meta>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://s.codepen.io/assets/libs/prefixfree.min.js"></script>
<script src="//cdn.jsdelivr.net/less/1.7.0/less.min.js"></script>
<style>
@import url('//weloveiconfonts.com/api/?family=entypo');
@import url('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css');