Skip to content

Instantly share code, notes, and snippets.

View anvie's full-sized avatar

Robin Syihab anvie

View GitHub Profile
{ "ts" : ISODate("2011-09-13T21:18:09.631Z"), "op" : "command", "ns" : "digaku.$cmd", "command" : { "count" : "user", "query" : { "_id" : { "$nin" : [
ObjectId("4e381d8ebf866c62bd000429"),
ObjectId("4ddd3441bf866c6b6d00108f"),
ObjectId("4c68d953b392ef3107000005"),
ObjectId("4dd5dccbbf866c143900017d"),
ObjectId("4ddcef06bf866c6b6d000d1d"),
ObjectId("4de5cf65bf866c06cf000426"),
ObjectId("4dd54661bf866c035600000f"),
ObjectId("4de236a2bf866c524e000342"),
ObjectId("4df56d24bf866c5a96000021"),
@anvie
anvie / gist:1370500
Created November 16, 2011 16:13
mr non sharded collection
function () {
var t, user_id;
t = this;
user_id = t._id.toString();
this._followed_user_ids.forEach(function (fuid) {
var u;
u = db.user.findOne({
_id: ObjectId(fuid)
});
if (u) {
(venv)AnlabMac:rest Robin$ nmap 175.41.170.246 -p 51021
Starting Nmap 5.51 ( http://nmap.org ) at 2011-11-21 03:36 WIT
Nmap scan report for ec2-175-41-170-246.ap-southeast-1.compute.amazonaws.com (175.41.170.246)
Host is up (0.079s latency).
PORT STATE SERVICE
51021/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 2.00 seconds
(venv)AnlabMac:rest Robin$ nmap 192.168.0.234 -p 51021
@anvie
anvie / gist:1524891
Created December 27, 2011 19:34
Armin Code Correction
diff --git a/js/coffee/Channel.coffee b/js/coffee/Channel.coffee
index 1fd7a05..a0b61b4 100755
--- a/js/coffee/Channel.coffee
+++ b/js/coffee/Channel.coffee
@@ -546,14 +546,18 @@ dg.channel.gsChannelMore = (ctl, elm_id) ->
, {'show_loading':false}
###
-Get similar channel a.k.a CYML
+Get similar channel a.k.a CYML.
@anvie
anvie / LuceneTest.scala
Created May 13, 2012 21:28
My lucene implementation test on Scala
package com.ansvia.belajar.lucene
import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.util.Version
import org.apache.lucene.store.SimpleFSDirectory
import java.io.{FileReader, File}
import org.apache.lucene.document.{Field, Document}
import org.apache.lucene.queryParser.QueryParser
@anvie
anvie / rootr.conf
Created June 5, 2012 09:25
Rootr configuration example
rootr {
# where's rootr api server bind to port
api.port = 8080
crawler {
# whether crawler skip to index already indexed source
skip_existing = true
}
package tests;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.NumericField;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.IndexSearcher;
@anvie
anvie / FileAppender.scala
Created June 23, 2012 04:49
File Appender in Scala
/*
* Copyright (c) 2012 Ansvia Inc.
* Author: robin
*/
package com.ansvia.rootr.storage
import java.io.{FileWriter, BufferedWriter, File}
/**
@anvie
anvie / Build.scala
Created June 30, 2012 09:16
Gather all dependencies jar and generate start script for running, all placed in `target/` dir
lazy val copyDependencies = TaskKey[Unit]("gather-lib")
def gatherDeps = copyDependencies <<= (update, crossTarget, scalaVersion, internalDependencyClasspath in Compile, mainClass in Runtime) map {
(updateReport, out, scalaVer, deps, main_class) =>
var projDeps = Array[String]()
deps.foreach {
depsDir =>
val x = depsDir.data.getCanonicalPath.split("/")
if (x.length > 3){
@anvie
anvie / Hello.scala
Created July 18, 2012 13:51
Materi Scala Belajar bersama di Ansvia HQ pertemuan ke 4
package com.ansvia.hello
/**
* Copyright (C) 2011-2012 Ansvia Inc.
* User: robin
* Date: 7/18/12
* Time: 7:40 PM
*
*/