Skip to content

Instantly share code, notes, and snippets.

View jjelosua's full-sized avatar

Juan Elosua jjelosua

View GitHub Profile
@jjelosua
jjelosua / compress-rm-onthefly.sh
Created January 29, 2019 03:25
Compress folder with MANY files (size) and remove the original on the fly
find wp-plugins -depth -print0 | xargs -0 gtar --create --no-recursion --remove-file --file - | gzip -9 > wp-plugins.tar.gz
@jjelosua
jjelosua / idp-georgia.scpt
Last active April 19, 2017 15:50
iTermV3 idp georgia apple script
tell application "iTerm2"
tell current window
tell current session
-- idp-georgia tool pane
set name to "idp-georgia"
set server to (split vertically with default profile)
-- CHANGE path to your needs
write text "cd ~/npr/projects/idp-georgia/"
write text "workon idp-georgia"
write text "git pull"
@jjelosua
jjelosua / integration-request-form-urlencoded-template
Last active January 24, 2023 12:31
AWS API Gateway - Integration Request application/x-www-form-urlencoded Body Template
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@jjelosua
jjelosua / Liveblog.scpt
Last active August 7, 2017 20:24
Liveblog helper
tell application "iTerm2"
tell current window
tell current session
-- liveblog tool pane
set name to "liveblog"
set server to (split vertically with default profile)
-- CHANGE path to your needs
write text "cd ~/npr/projects/liveblog/"
write text "workon liveblog"
write text "git pull"
[16-09-08 15:37:56:378 EDT] Starting execution
[16-09-08 15:37:56:716 EDT] SpreadsheetApp.create([Test BetterLog]) [0.332 seconds]
[16-09-08 15:37:56:716 EDT] Spreadsheet.getId() [0 seconds]
[16-09-08 15:37:56:770 EDT] SpreadsheetApp.openById([1AKlnpJjv-sFp6WzULcPE23nPHwAGknQwJdtWCyOehvM]) [0.053 seconds]
[16-09-08 15:37:56:771 EDT] Spreadsheet.getSheets() [0 seconds]
[16-09-08 15:37:56:771 EDT] Sheet.getName() [0 seconds]
[16-09-08 15:37:56:827 EDT] Spreadsheet.insertSheet([Log, 1]) [0.055 seconds]
[16-09-08 15:37:56:855 EDT] Sheet.getMaxColumns() [0.027 seconds]
[16-09-08 15:37:56:903 EDT] Sheet.deleteColumns([2, 25]) [0.047 seconds]
[16-09-08 15:37:56:904 EDT] Sheet.getRange([1, 1]) [0 seconds]
@jjelosua
jjelosua / Multipart-related drive v2 api.py
Created July 18, 2016 19:58
Body serialization for a sucessfull multipart/related upload to google drive
@jjelosua
jjelosua / iterm_dailygraphics.scpt
Last active August 5, 2019 20:06
Applescript to launch dailygraphics iTerm configuration (iTerm v3)
tell application "iTerm2"
tell current window
tell current session
-- dailygraphics tool pane
set name to "dailygraphics"
set webserver to (split vertically with default profile)
-- CHANGE path to your needs
write text "cd ~/npr/projects/dailygraphics/"
write text "workon dailygraphics"
write text "git pull"
@jjelosua
jjelosua / README.md
Created March 15, 2016 18:33
d3intro_ex05
@jjelosua
jjelosua / README.md
Created March 15, 2016 17:13
d3intro_ex02
@jjelosua
jjelosua / README.md
Created March 15, 2016 17:05
d3intro_ex02