Skip to content

Instantly share code, notes, and snippets.

View elventear's full-sized avatar
🧙‍♂️
Conjuring

Pepe Barbe elventear

🧙‍♂️
Conjuring
View GitHub Profile
@elventear
elventear / gist:3863471
Last active October 11, 2015 13:07
#query #lucene from #gremlin on #neo4j
// Source: https://groups.google.com/forum/#!topic/neo4j/x_US3cIH5wU
index = g.getRawGraph().index()
products = index.forNodes('products')
hits = products.query("name:*foo*")
results = new com.tinkerpop.blueprints.pgm.impls.neo4j.util.Neo4jVertexSequence(hits, g)._().map.toList()
@elventear
elventear / gist:4583467
Last active December 11, 2015 09:58
Use #gremlin #shell on read-only #neo4j #debug #development #shell
// Source: https://groups.google.com/forum/?fromgroups=#!topic/gremlin-users/60NUGlnyCkw
import org.neo4j.kernel.EmbeddedReadOnlyGraphDatabase
db = new EmbeddedReadOnlyGraphDatabase('/var/lib/neo4j/data/graph.db')
g = new Neo4jGraph(db)
@elventear
elventear / gist:5491822
Last active December 16, 2015 20:19
#reset #git author of #commit
git commit --amend --reset-author
@elventear
elventear / wait.sh
Created May 7, 2013 14:38
#bash wait on #background jobs and #subshells
#!/bin/bash
# http://jeremy.zawodny.com/blog/archives/010717.html
FAIL=0
echo "starting"
./sleeper 2 0 &
./sleeper 2 1 &
./sleeper 3 0 &
@elventear
elventear / gist:5600769
Created May 17, 2013 17:58
#git #amend #date of commit
git commit --amend --date="$(date -R)"
@elventear
elventear / gist:5670630
Created May 29, 2013 14:22
#shell script to #move #types
#!/usr/bin/env zsh
local SCRIPT_NAME=$(basename $0)
local SCRIPT_DIR=$(dirname $0)
. $SCRIPT_DIR/../dependencies/zsh-functional/functional.plugin.zsh
function usage {
test ${#1} -gt 0 && echo ERROR: $1
echo $SCRIPT_NAME SOURCE_TYPE DEST_TYPE
@elventear
elventear / gist:5759978
Created June 11, 2013 19:45
Make #MacVim new #splits #vertical
defaults write org.vim.MacVim MMVerticalSplit YES
@elventear
elventear / wget-alias.terminal
Created November 25, 2013 13:10 — forked from philiparthurmoore/wget-alias.terminal
Make a curl behave like wget with an alias
alias wget="curl -O --retry 999 --retry-max-time 0 -C -"
##
# Line should be placed at ~/.bash_profile
# Source: http://www.mymacosx.com/terminal/wget-replacement-macos.html
# Source: http://superuser.com/questions/142459/persistent-retrying-resuming-downloads-with-curl
##
@elventear
elventear / gist:9942740
Last active August 29, 2015 13:58 — forked from michalbcz/gist:2757630
emulate collectWithIndex
List.metaClass.collectWithIndex = { yield ->
def collected = []
delegate.eachWithIndex { listItem, index ->
collected << yield(listItem, index)
}
return collected
}
assert [1, 1, 1, 1, 1].collectWithIndex { it, index -> it + index } == [1, 2, 3, 4, 5]

Keybase proof

I hereby claim:

  • I am elventear on github.
  • I am elventear (https://keybase.io/elventear) on keybase.
  • I have a public key whose fingerprint is 3CF5 94D8 6350 A6EC 088A 4F6E FF3F A3A3 6A35 26BA

To claim this, I am signing this object: