Skip to content

Instantly share code, notes, and snippets.

View acro5piano's full-sized avatar
🏠
Working from home

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
@doyle
doyle / gist:92b0b34cd4804d237ed9661e20e33e5d
Created October 17, 2016 19:51
Use curl to upload a file to a S3 pre-signed url
curl -X PUT -T test_s3.txt -L "https://your-bucket.s3.amazonaws.com/url-stuff"
@MarkusPfundstein
MarkusPfundstein / javascript.js
Last active November 6, 2019 00:01
pattern matching function using ramda
/*
* examples - code for matchC is below
* to test: copy&paste into http://ramdajs.com/repl
*/
function main() {
// its all good if all output lines have true in first tuple ;-)
const m1 = matchC('Hello')
.when('string', a => [true, a.toUpperCase()])
.when('number', a => [false, a])
@milocosmopolitan
milocosmopolitan / ngrok-installation.md
Last active June 21, 2023 16:31
Install ngrok on Mac OS X El Captin(10.11)

#Installing ngrok on OSX

When you try to install with downloaded zip file from ngrok website, alert message will pop up and tell you "ngrok" can't be opened because it is from an unidentified developer.

You can simply use homebrew to install this without any issue.

  1. Open your terminal
  2. $ brew cask install ngrok
@magemore
magemore / example.js
Created August 10, 2016 10:13
upload image from clipboard on ctrl+v event on page
function uploadFile(file) {
var formData = new FormData();
formData.append("userfile", file);
var request = new XMLHttpRequest();
request.onload = function () {
if (request.status == 200) {
document.location.href='/';
} else {
alert('Error! Upload failed');
}
@bcherny
bcherny / react-rollup-typescript.md
Last active January 30, 2024 12:13
react + rollup + typescript boilerplate

terminal:

npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsx
@jarretmoses
jarretmoses / React Native Clear Cache
Last active April 13, 2025 12:22
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@yuasatakayuki
yuasatakayuki / ssd1306_japanese_font.py
Created June 19, 2016 05:26
Raspberry Pi 3で128×64ピクセルのOLEDに日本語を表示するサンプル
# -*- coding: utf-8 -*-
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
import Image
import ImageDraw
import ImageFont
# Raspberry Pi pin configuration
@PaulKinlan
PaulKinlan / add-to-homescreen-test.html
Last active September 24, 2020 20:37
iOS Add to Homescreen => simulate web app manifest
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Add to Homescreen</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Test name 2">
@satoshin2071
satoshin2071 / new_gist_file.md
Created June 13, 2016 07:36
TestFlightへのアップロード手順

TestFlightへのアップロード手順

前提条件

  • iTunes Connectへサインイン可
  • テスト対象アプリとアカウントの紐付けが完了している
  • Distribution用の証明書がキーチェーンのログイン項目に登録されていること
  • Distribution用のプロビジョニングが追加されていること
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 19, 2025 12:34
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker