Skip to content

Instantly share code, notes, and snippets.

View umihico's full-sized avatar

Umihiko Iwasa umihico

View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@MKagesawa
MKagesawa / docker-compose.yml
Created August 21, 2018 08:07
Docker-compose MySQL Image create multiple databases
# The official MySQL (https://hub.docker.com/_/mysql/) supports only one MYSQL_DATABASE environment variable.
# By modifying the entrypoint and passing shell script, you can create multiple dbs without having to make a mysql image just for this purpose.
version: '3'
services:
# Some other service connecting to mysql
db:
image: mysql:5.6
AWSTemplateFormatVersion: "2010-09-09"
Description: >
Launch a static website backed by an S3 bucket and served via https through cloudfront.
Assumes you have the following available already
* An address in mind (e.g. blog.example.com)
* An existing Route53 Hosted Zone for the domain
* A validated AWS ACM certificate arn for the desired web address which must be in eu-west-1
Parameters:
HostedZoneID:
Description: >
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@Spencer-Easton
Spencer-Easton / exportSpreadsheet.gs
Last active March 21, 2024 00:43
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@brettlangdon
brettlangdon / Wallpapers.md
Last active December 22, 2023 16:38
Wallpapers

Wallpapers

Install with git git clone https://gist.github.com/85942af486eb79118467.git ~/Pictures/wallpapers

@jordanbaucke
jordanbaucke / bitfinex-python.py
Created June 19, 2013 06:16
Python example code for an authenticated call to Bitfinex API v1
import requests # pip install requests
import json
import base64
import hashlib
import time #for nonce
api_key = ''
api_secret = ''
#url = 'https://bitfinex.com/api/v1/order/new'
@JeffPaine
JeffPaine / make_github_issue.py
Created July 19, 2012 17:24
Make an issue on github using API V3 and Python
import json
import requests
# Authentication for user filing issue (must have read/write access to
# repository to add issue to)
USERNAME = 'CHANGEME'
PASSWORD = 'CHANGEME'
# The repository to add this issue to
REPO_OWNER = 'CHANGEME'