Skip to content

Instantly share code, notes, and snippets.

Eat Sleep Code Repeat

Frank Hassanabad FrankHassanabad

Eat Sleep Code Repeat
View GitHub Profile
dcode /
Last active April 10, 2020 20:28
This snippet configures bro to write logs out in JSON instead of the tab-delimited format. It also configures it to use ISO8601 timestamps instead of unix epoch time.
## Configure bro to write JSON logs
mkdir -p /opt/bro/share/bro/site/scripts
sudo tee /opt/bro/share/bro/site/scripts/json-logs.bro << EOF
@load tuning/json-logs
redef LogAscii::json_timestamps = JSON::TS_ISO8601;
redef LogAscii::use_json = T;
sudo tee -a /opt/bro/share/bro/site/local.bro << EOF
cletusw / .eslintrc
Last active April 29, 2023 03:59
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
View .eslintrc
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
joyrexus /
Created March 28, 2014 14:49
Nested grouping of arrays


A multi-level groupBy for arrays inspired by D3's nest operator.

Nesting allows elements in an array to be grouped into a hierarchical tree structure; think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table. The levels in the tree are specified by key functions.

View webpack.js
// webpack is a module bundler
// This means webpack takes modules with dependencies
// and emits static assets representing those modules.
// dependencies can be written in CommonJs
var commonjs = require("./commonjs");
// or in AMD
define(["amd-module", "../file"], function(amdModule, file) {
// while previous constructs are sync
// this is async
dwayne /
Last active October 21, 2019 06:08
My notes from the book "ng-book: The Complete Book on AngularJS by Ari Lerner".


Author: Ari Lerner.

AngularJS offers a single framework that can be used to build dynamic, client-centric applications. It provides:

  • Module support
  • DOM manipulation
  • Animations
  • Templating
auser / day1.js
Created December 2, 2013 01:00
Day1 gist
View day1.js
angular.module('', [])
.factory('UserFactory', function($http, $q) {
var service = {
// our factory definition
user: {},
setName: function(newName) {
service.user['name'] = newName;
setEmail: function(newEmail) {
service.user['email'] = newEmail;
View gist:5271721
description "MyApp"
author "MyApp by charlie"
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
start on runlevel [23]
stop on shutdown
mbostock / .block
Last active April 26, 2019 04:42
Concentric Circles Emanating
View .block
license: gpl-3.0
coolaj86 /
Last active April 17, 2023 19:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!


  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
mbostock / .block
Last active March 29, 2023 23:39
Collapsible Indented Tree
View .block
license: gpl-3.0