Skip to content

Instantly share code, notes, and snippets.


Michoel Samuels AnalyzePlatypus

  • Jerusalem, Israel
View GitHub Profile
sainf /
Last active Feb 18, 2020 — forked from AnalyzePlatypus/
Helper function for line-wrapping in jsPDF
EvanBacon / apple-touch-startup-image.html
Created Apr 17, 2019
An example of full iOS PWA startup image (splash screen) support.
View apple-touch-startup-image.html
<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" />
cellularmitosis / EmojiPointersDemo.swift
Created Aug 15, 2018
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
View EmojiPointersDemo.swift
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
View index.js
// install first binaries from
// @author Andrzej Ojczenasz
// @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];
xola139 / Invalid Host Header NGROK
Created Feb 19, 2018
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
View Invalid Host Header NGROK
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
bradwestfall /
Last active Jul 23, 2021
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect to
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation


primaryobjects / mouse.gif
Last active Mar 9, 2021
View the mouse pointer position in Selenium Nightwatch. Execute this code when the page loads or in the javascript console. See
milon87 / api.js
Created Sep 9, 2017
how to use x-www-form-urlencoded in react native
View api.js
var details = {
'userName': '',
'password': 'Password!',
'grant_type': 'password'
var formBody = [];
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
shapeshed / aws-cf-logs
Last active Feb 12, 2021
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
View aws-cf-logs
#!/usr/bin/env bash
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz
rosenfeld / thread-pool.rb
Created Jun 7, 2016
Simple thread pool implementation in Ruby
View thread-pool.rb
require 'thread' # for Mutex: Ruby doesn't provide out of the box thread-safe arrays
class ThreadPool
def initialize(max_threads = 10)
@pool =
max_threads.times{ @pool << 1 }
@mutex =
@running_threads = []