Skip to content

Instantly share code, notes, and snippets.

View ebouchut's full-sized avatar

Eric Bouchut ebouchut

View GitHub Profile
tar cvzf ~/backup/project.tar.gz --dereference --exclude-vcs --exclude=/target/ project
@ebouchut
ebouchut / gist:83274db70170e363b444
Created July 20, 2015 15:49
Send a file to a URL using curl
curl $URL --data @$FILE -vv -L -H "Content-Type:application/json"
# curl $URL --trace-ascii - --data @$FILE -L -H "Content-Type:application/json"
# Remove comment that spans a whole line (like this one)
# and comments at the end of a line like the following
: echo "Hello" # comment at the end of a line
sed -e 's/#.*$//g' -e '/^[ \t]*$/d' file
@ebouchut
ebouchut / formatDateAsUTC.java
Last active October 6, 2019 14:52
Format a Java Date as UTC String: yyyy-mm-dd HH:mm:ss'Z'
publicString formatDateAsUTC(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.format(date);
}
@ebouchut
ebouchut / set_SQL_sequence.sql
Last active July 29, 2019 14:23
Set SQL sequence
-- reset sequence to the max value of its ids
SELECT setval('public.mytable_id_seq', (SELECT MAX(id) FROM mytable));
-- get the last value of a sequence
SELECT last_value FROM mytable_id_seq;
@ebouchut
ebouchut / solarized-dark.css
Created February 7, 2017 14:44 — forked from qguv/solarized-dark.css
Solarized theme for Jekyll, updated to reflect toned-down line numbers
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content