Skip to content

Instantly share code, notes, and snippets.

Jay lakemove

Block or report user

Report or block lakemove

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lakemove
lakemove / gist:34602b4c7c64052ae563cb27f5dd5cfe
Last active Sep 9, 2019
search, select and execute from bash history
@lakemove
lakemove / groovy-in-bash.sh
Created Jan 13, 2018
run groovy script in bash script
View groovy-in-bash.sh
#!/bin/bash
GREETINGS='HELLO GROOVY AND BASH'
echo $GREETINGS
#to interpret bash variable , remove single quotes in 'EOF'
groovy -e "new GroovyShell().evaluate(System.in.text)" <<'EOF'
println("this is groovy print")
EOF
@lakemove
lakemove / run-groovy.ipynb
Created Jan 13, 2018
run groovy in jupyter/ipython notebook, put it in one cell and ctrl+enter to run
View run-groovy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lakemove
lakemove / pom.xml
Created Jun 9, 2012
maven pom.xml basic structure
View pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.liulijie</groupId>
<artifactId>blog-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
@lakemove
lakemove / oneliner.groovy
Created Jun 20, 2017
one liner in groovy
View oneliner.groovy
//turn list into map
assert [1:2,3:4] == [[1,2],[3,4],[1,2]].collectEntries {it} //{[it[0],it[1]]}
//sublist from nth to end
assert [3,4,5,6] == [1,2,3,4,5,6][2..-1]
assert [3,4,5,6] == [1,2,3,4,5,6][2, 3..-1]
//string to number
assert 1.2 == "1.2" as double
@lakemove
lakemove / coursera_download.sh
Created Mar 23, 2016
download all video lectures, of a single course
View coursera_download.sh
curl -s -b "$cookie" "https://class.coursera.org/bitcointech-001/lecture" | grep download.mp4\?lecture_id | awk -F\" '{print $4}' | xargs curl -s -b "$cookie" | awk -F\" '{print $2}' | while read -r line; do wget --content-disposition "$line" ;done
while read -r line; do wget --content-disposition "$line"; done
@lakemove
lakemove / ti-svn-structure.sh
Created Mar 28, 2013
showcase svn automated operations and invoking Java from shell script
View ti-svn-structure.sh
#!/bin/bash
WORKDIR=/tmp/svn-work-dir
mkdir $WORKDIR && cd $WORKDIR
svn info svn+ssh://subversion.evenex.com/svn/comp/OutgoingDocumentReceiveService/branches/FDD-4256 >/dev/null
if [ $? -eq 0 ]; then
echo "branch already exist, delete it [y/n](y)?"
svn rm svn+ssh://subversion.evenex.com/svn/comp/OutgoingDocumentReceiveService/branches/FDD-4256 -m "delete to create"
fi
@lakemove
lakemove / jgit.sh
Created Mar 21, 2013
self-executable shell commandline shamelessly copied from [jgit|http://www.eclipse.org/jgit/download/]
View jgit.sh
cmd=
for a in "$@"
do
case "$a" in
-*) continue ;;
*) cmd=$a; break; ;;
esac
done
use_pager=
@lakemove
lakemove / blog-app.conf
Created Oct 29, 2012
node upstart script
View blog-app.conf
description "blog-app server"
author "Jay"
start on startup
stop on shutdown
script
#Your scripts
cd /home/jay/works/blog-app
@lakemove
lakemove / web
Created Oct 25, 2012
The essence of this technique
View web
//pure-CSS drop down menus
div.menu-bar ul ul {
display: none;
}
div.menu-bar li:hover > ul {
display: block;
}
//image pre-loader
function preloadImages() {
You can’t perform that action at this time.