Skip to content

Instantly share code, notes, and snippets.

{
"version": "https://jsonfeed.org/version/1",
"title": "GDELT - BORDER, EPU_ECONOMY, geoname:Ireland, lang:eng",
"home_page_url": "https://api.gdeltproject.org/api/v1/gkg_geojson?QUERY=BORDER,EPU_ECONOMY,geoname:Ireland,lang:eng&TIMESPAN=1000&MAXROWS=500&OUTPUTFIELDS=name,url,domain,sharingimage,geores,themes",
"feed_url": "https://api.gdeltproject.org/api/v1/gkg_geojson?QUERY=BORDER,EPU_ECONOMY,geoname:Ireland,lang:eng&TIMESPAN=1000&MAXROWS=500&OUTPUTFIELDS=name,url,domain,sharingimage,geores,themes",
"description": "Mon Nov 26 22:03:02 UTC 2018",
"items": [
{
"id": "https://www.azernews.az/region/141542.html",
"title": "Ireland: 141542",
@diplodata
diplodata / eng_41320.csv
Created July 1, 2018 11:51
41,320 English words
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
w
borough
deranging
kinship
these
aggrieve
tapering
ungrudging
okra
modem
@diplodata
diplodata / aws-s3-list-bucket-size.sh
Created June 16, 2018 16:25 — forked from zerowebcorp/aws-s3-list-bucket-size.sh
AWS S3 List all buckets size
for dir in $(aws s3 ls | awk '{print $3'}); do
size=$(aws s3 ls s3://${dir} --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}');
echo "${dir} => $size" | tee -a disk.txt
done
@diplodata
diplodata / test.csv
Created May 17, 2018 14:00
upsetR test data
A B C D E F G H I J K L M N O
0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 1 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 1 1 0 0 0 0 0 0 0
0 0 0 1 1 0 0 1 0 0 0 0 0 0 0
0 0 0 1 1 1 1 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 1 1 1 0 0 0 0 0 0 0
@diplodata
diplodata / install.sh
Created January 21, 2018 00:03 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@diplodata
diplodata / install_postgresql.sh
Created January 18, 2018 16:47 — forked from dstroot/install_postgresql.sh
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
@diplodata
diplodata / levenshtein.js
Created September 16, 2017 22:29 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@diplodata
diplodata / README.md
Created September 14, 2017 08:23
Shiny script to automate commit push to a Github repo

You can configure a Shinyapps app to run a script that pushes a commit to a Github repo. Just:

  • set up a Github access token with minimal permissions, e.g. Settings / Personal access tokens / Generate new token (tick repo permissions)
  • deploy script to shinyapps.io, eg. rsconnect::deployApp(account = 'accountname')
  • trigger it with a remote call (eg. crontab) like curl https://accountname.shinyapps.io/app_name/index.php