Skip to content

Instantly share code, notes, and snippets.

View achmadns's full-sized avatar

Achmad Nasirudin Sandi achmadns

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active November 18, 2024 16:37
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@geowarin
geowarin / ProxyUtils.java
Created May 7, 2015 17:49
Get the object behind a Spring proxy
package masterspringmvc4.utils;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
public class ProxyUtils {
public static <T> T getProxyTarget(Object proxy) {
if (!AopUtils.isAopProxy(proxy)) {
throw new IllegalStateException("Target must be a proxy");
@kbastani
kbastani / gist:4471127413fd724ed0a3
Last active December 30, 2019 03:38
GraphGist of Neo4j Access Control
= Entitlements and Access Control Management
:neo4j-version: 2.2.0
:author: Kenny Bastani
:twitter: @kennybastani
:description: Graph database access control, entitlements, authorization solutions
:tags: domain:finance, use-case:access-control
This interactive Neo4j graph tutorial covers entitlements and access control scenarios.
'''
@brenopolanski
brenopolanski / install-firefox-nightly.md
Created July 30, 2014 00:34
Install Firefox Nightly in Ubuntu via PPA

via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html

Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

@lordjc
lordjc / csv2metadata.py
Created March 21, 2014 19:45
Generate Avro schema and DDLs from CSV headers
#!/usr/bin/python
import csv
import sys
import argparse
from string import Template
import subprocess
debug = False
def output(hdfspath,data):
@denji
denji / http-benchmark.md
Last active October 13, 2024 00:43
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
package demo;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.MapWritable;
@netsensei
netsensei / Gruntfile.js
Created December 15, 2013 14:34
Grunt + Jekyll + Compass. Acts as a double pipeline: one line acts on HTML file changes, rebuilding the entire project, the second pipeline just acts on SCSS changes: watch, compile & copy to the jekyll compiled css folder. Includes livereload support via nodejs! Based on https://github.com/thanpolas/thanpolas.github.com/blob/master/Gruntfile.js
module.exports = function (grunt) {
"use strict";
// Config...
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
css : {
src: 'css/**',
@mjallday
mjallday / gist:7590598
Created November 21, 2013 22:04
purge all rabbitmq queues
rabbitmqadmin list queues | cut -d '|' -f 3 | grep -v \+ | xargs -n1 -I@ rabbitmqadmin purge queue name=@