Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
@jensarps
jensarps / closure-compiler-config-2.js
Last active December 20, 2015 03:19
Snippets from my post on creating dynamic/configurable builds with Grunt and Closure Compiler.
//configure closure compiler
var closureFiles = handlerClassNames.map(function (name) {
return 'src/' + name + '.js';
});
closureFiles.unshift('src/InputController.js');
closureFiles.push('build/bundle.js');
/* ... */
grunt.config.set('closure-compiler.bundle', {
closurePath: 'lib/closure',
jsOutputFile: 'build/input-controller.js',
@gmodarelli
gmodarelli / Setup Solarized for Gnome on Ubuntu 13.04.md
Last active July 14, 2020 15:59
Setup Solarized for Gnome on Ubuntu 13.04

Dark version

wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
mv dircolors.ansi-dark .dircolors
eval `dircolors ~/.dircolors`

git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./set_dark.sh
user=> (print-cause-trace *e)
clojure.lang.Compiler$CompilerException: java.lang.NullPointerException, compiling:(NO_SOURCE_FILE:1)
at clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3387)
clojure.lang.Compiler$DefExpr.eval (Compiler.java:398)
clojure.lang.Compiler.eval (Compiler.java:6516)
clojure.lang.Compiler.eval (Compiler.java:6477)
clojure.core$eval.invoke (core.clj:2797)
clojure.main$repl$read_eval_print__6405.invoke (main.clj:245)
clojure.main$repl$fn__6410.invoke (main.clj:266)
clojure.main$repl.doInvoke (main.clj:266)
@tuxdna
tuxdna / WordCountAverage.java
Last active May 14, 2021 10:14
Word Length Average Map-Reduce using a Combiner
package org.apache.hadoop.examples;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.DoubleWritable;
@mheadd
mheadd / monitor.sh
Created May 13, 2013 20:00
Simple bash script to check whether MySQL is running.
#!/bin/bash
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
sudo service mysql start
else
echo "All is well.";
fi
@naoyamakino
naoyamakino / railsConfElasticSearchNote.md
Last active December 16, 2015 21:09
Using elastic search with rails app via Brian Gugliemetti #railsConf

Using elastic search with rails app via Brian Gugliemetti

http://www.elasticsearch.org/

elastic search

  • RESTful search engine built on top of Apache

wanted: autocomplete, replace database full-text search, bring site earch in-house

Terms

node: instance of elasticsearch which belongs to a cluster

@eurica
eurica / s3upload.sh
Created May 1, 2013 00:46
A bash script to upload files for static hosting on s3
# Bash script to upload files to static s3 hosting with s3cp
# [email protected] April 30th, 2013
# Modified from https://github.com/roqs23/sync-svn-updates-to-s3/blob/master/svnupd2s3.sh
export COMMON_HEADER="--header \"x-amz-acl: public-read\" --header \"Vary: Accept-Encoding\" "
export HTML_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: text/html\""
export CSS_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: text/css\""
export JS_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: application/javascript\""
export PNG_HEADER="--header \"Cache-Control: max-age=2592000,must-revalidate\" --header \"Content-Type: image/png\""
export GIF_HEADER="--header \"Cache-Control: max-age=2592000,must-revalidate\" --header \"Content-Type: image/gif\""
# Install java and make sure JAVA_HOME is properly set.
# Make sure those dependencies are present:
sudo apt-get install g++ uuid-dev libtool autoconf automake
cd ~
# install zeromq
wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
tar -xzf zeromq-2.1.7.tar.gz
@mrflip
mrflip / 20130416-todo.md
Last active April 22, 2025 14:33
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)
package net.ladstatt.apps
import java.io.File
import org.opencv.core.Core
import org.opencv.core.MatOfRect
import org.opencv.core.Point
import org.opencv.core.Scalar
import org.opencv.highgui.Highgui
import org.opencv.objdetect.CascadeClassifier