This file contains hidden or 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 | |
DOWNLOAD_DIR="/tmp" | |
EXTRACT_DIR="/var/xxxx/yyyy" | |
ACCOUNT_ID=NNNNNNN | |
LICENSE_KEY=xxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyy_zzz | |
TEMP_FILE="tmp_downloaded_geolite2.tar.gz" | |
if ! curl -o "${DOWNLOAD_DIR}/${TEMP_FILE}" -J -L -u $ACCOUNT_ID:$LICENSE_KEY 'https://download.maxmind.com/geoip/databases/GeoLite2-Country/download?suffix=tar.gz'; then | |
echo "Error: File download failed." |
This file contains hidden or 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/env perl | |
use strict; | |
use warnings; | |
use v5.10; | |
use Data::Dumper; | |
use File::Slurp; | |
use IO::File; | |
use Log::Minimal; | |
use Time::Piece; |
This file contains hidden or 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
// see also https://developers.cloudflare.com/r2/examples/cache-api/ | |
export default { | |
async fetch(request, env, context) { | |
try { | |
const url = new URL(request.url); | |
// Construct the cache key from the cache URL | |
const cacheKey = new Request(url.toString(), request); | |
const cache = caches.default; | |
This file contains hidden or 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
function myFunction() { | |
var form = FormApp.getActiveForm(); | |
var response = UrlFetchApp.fetch("https://XXXXX.example.com/google_drive_file.json"); | |
var json=JSON.parse(response.getContentText()); | |
Logger.log(json); | |
// http://www.koikikukan.com/archives/2011/04/05-025555.php | |
var sort_by = function(field, reverse, primer) { | |
reverse = (reverse) ? -1 : 1; | |
return function(a,b){ |
This file contains hidden or 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
#!/usr/bin/env perl -w | |
use 5.20.0; | |
use utf8; | |
use Data::Dumper; | |
use IO::File; | |
use JSON; | |
use Net::Google::Drive::Simple; | |
use Text::CSV_XS; | |
# requires a ~/.google-drive.yml file with an access token, |
This file contains hidden or 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
#!/usr/bin/env perl -w | |
# This script starts a web server on port 8082 on your local machine. | |
# When you point your browser at http://localhost:8082, you'll see a link | |
# that will lead you to Google Drive's login page, where you authenticate and | |
# then allow the app (specified by client_id and client_secret below) access to | |
# your Google Drive data. The script will then receive an access token | |
# from Google Drive and store it in ~/.google-drive.yml from where | |
# other scripts can pick it up and work on the data stored on the user's | |
# Google Drive account. | |
# Note that you need to obtain client_id and a client_secret below from |
This file contains hidden or 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
// http://graphql.org/code/#javascript | |
var express = require('express'); | |
var graphqlHTTP = require('express-graphql'); | |
var { buildSchema } = require('graphql'); | |
var schema = buildSchema(` | |
type Shop { | |
id: ID! | |
name: String! | |
station: String |
This file contains hidden or 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
/** | |
* @file Ingress portal level crawler with PhantomJS | |
* @author teckl (https://github.com/teckl) | |
* @version 0.0.1 | |
* @license MIT | |
* @see {@link https://github.com/nibogd/tg-ingress-scorebot|GitHub } | |
* @see {@link https://github.com/jonatkins/ingress-intel-total-conversion|GitHub } | |
*/ | |
"use strict"; |