This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"crypto/sha1" | |
"encoding/base64" | |
"encoding/binary" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
) | |
func main() { | |
id := make([]byte, 16) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history | dmenu -l 10 | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd= | |
for a in "$@" | |
do | |
case "$a" in | |
-*) continue ;; | |
*) cmd=$a; break; ;; | |
esac | |
done | |
use_pager= |
NewerOlder