Skip to content

Instantly share code, notes, and snippets.

View AnalyzePlatypus's full-sized avatar
🐏
Bah.

Michoel Samuels AnalyzePlatypus

🐏
Bah.
View GitHub Profile
@milon87
milon87 / api.js
Created September 9, 2017 05:37
how to use x-www-form-urlencoded in react native
var details = {
'userName': 'test@gmail.com',
'password': 'Password!',
'grant_type': 'password'
};
var formBody = [];
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
@runeb
runeb / js-exif-rotate.html
Created May 23, 2014 10:49
Auto-rotate images locally in the browser by parsing exif data
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input id="file" type="file" accept="image/*" />
<br/>
<h2>As read:</h2>
<img id="placeholder1" width=300/><br/>
<h2>Rotated by exif data:</h2>
<img id="placeholder2" width=300/>
<script>
@mlschmitt
mlschmitt / Merlin_Wisdom_Widget_Scriptable.js
Last active May 19, 2023 16:58
Random wisdom from Merlin Mann in a handy widget - https://github.com/merlinmann/wisdom
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: brain;
let items = await loadItems()
if (config.runsInWidget) {
let widget = await createWidget(items)
Script.setWidget(widget)
} else if (config.runsWithSiri) {
let firstItems = items.slice(0, 5)
let table = createTable(firstItems)
@mike-weiner
mike-weiner / basecamp.py
Last active August 23, 2023 14:36
A Python script to make calls to the Basecamp 4 API via OAuth authentication.
import datetime
import json
import os.path
import requests
# TO DO: Enter Your BC Account ID
# Example: 999999999 from https://3.basecamp.com/999999999/
BC_ACCOUNT_ID = "<your-client-id>"
# Basecamp App Integration Information
@ojczeo
ojczeo / index.js
Last active August 25, 2023 03:19
audiowaveform for lambda - https://github.com/bbc/audiowaveform
// install first binaries from http://ffxsam.s3.amazonaws.com/public/audiowaveform-lambda.zip
// @author Andrzej Ojczenasz https://github.com/ojczeo
// @version '1.0.0'
'use strict';
process.env.PATH = process.env.PATH + ':' + process.env.LAMBDA_TASK_ROOT + '/bin';
function getExtension(filename) {
var ext = path.extname(filename||'').split('.');
return ext[ext.length - 1];
@colingourlay
colingourlay / apple-web-dynamic-type.css
Last active September 16, 2023 15:43
Support Apple's dynamic text sizing in web content (iOS Safari & WebViews)
/*
To support dynamic type in iOS, we need to set Apple's
system font and then define font-families and rem-based
font-sizes on descendant elements:
*/
@supports (font: -apple-system-body) {
html {
font: -apple-system-body;
}
}
@fcingolani
fcingolani / index.html
Created August 9, 2012 02:16
How to render a full PDF using Mozilla's pdf.js
<html>
<body>
<!-- really dirty! this is just a test drive ;) -->
<script type="text/javascript" src="https://raw.github.com/mozilla/pdf.js/gh-pages/build/pdf.js"></script>
<script type="text/javascript">
function renderPDF(url, canvasContainer, options) {
var options = options || { scale: 1 };
@EvanBacon
EvanBacon / apple-touch-startup-image.html
Created April 17, 2019 07:10
An example of full iOS PWA startup image (splash screen) support.
<html>
<head>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-title" content="Expo" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link
rel="apple-touch-icon"
sizes="180x180"
@xola139
xola139 / Invalid Host Header NGROK
Created February 19, 2018 19:17
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok.
ngrok http 8080 -host-header="localhost:8080"
ngrok http --host-header=rewrite 8080
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt