Skip to content

Instantly share code, notes, and snippets.

www.googleadservices.com
rakuten.com
cashrewards.com
cashrewards.com.au
ad.zanox.com
adidas-australia.pxf.io
adorama.evyy.net
amazon.com.au
anrdoezrs.net
aos.prf.hn
@ivmreg
ivmreg / clean_code.md
Created February 6, 2019 22:00 — forked from wojteklu/clean_code.md
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

@ivmreg
ivmreg / cntlm_npm.md
Created January 17, 2018 00:12 — forked from triskell/cntlm_npm.md
[Windows 7] CNTLM and NPM behind NTLM proxy

CNTLM and NPM behind NTLM proxy on Windows 7

CNTLM

  • Install CNTLM in a folder where you have full rights to run it as administrator.

  • Open cntlm.ini and fill it :

Username    YOUR_USERNAME
Domain YOUR_DOMAIN
@ivmreg
ivmreg / gist:3fb38ee38789d82345d2857b336d4359
Created December 7, 2017 00:22
copy all nodes from one database to another
public void dumpAndLoadTo(String targetPath) throws IOException, InterruptedException {
// I first tried something like this:
// neo4j-shell -path outDir -c "DUMP MATCH n RETURN n;" | neo4j-shell -path targetPath -file -
// but performance was horrible upon import.
// See http://stackoverflow.com/questions/28246416/neo4j-export-import-data .
logger.info("Loading to db " + targetPath);
GraphDatabaseService dbSrc = getDb();
GraphDatabaseService dbDest = getDb(targetPath);
@ivmreg
ivmreg / gist:938683ecbc9f92367042f3384006fc38
Created April 17, 2017 10:07 — forked from PirosB3/gist:81047a463d687034e5d1
SMO SVM Python implementation
def smoSimple(dataIn, classLabels, C, tolerance, maxIter):
dataMatrix = mat(dataIn)
labelMat = mat(classLabels).T
m, n = shape(dataMatrix)
alphas = mat(zeros((m,1)))
bias = 0
iter = 0
while (iter < maxIter):
@ivmreg
ivmreg / multiclass_svm.py
Created April 17, 2017 09:58 — forked from mblondel/multiclass_svm.py
Multiclass SVMs
"""
Multiclass SVMs (Crammer-Singer formulation).
A pure Python re-implementation of:
Large-scale Multiclass Support Vector Machine Training via Euclidean Projection onto the Simplex.
Mathieu Blondel, Akinori Fujino, and Naonori Ueda.
ICPR 2014.
http://www.mblondel.org/publications/mblondel-icpr2014.pdf
"""