Skip to content

Instantly share code, notes, and snippets.

View galdolber's full-sized avatar

Gal Dolber galdolber

View GitHub Profile
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@Arinerron
Arinerron / root.sh
Last active March 7, 2024 09:24
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
@borkdude
borkdude / js_parser.clj
Last active August 6, 2023 22:14
Parse JavaScript in Clojure using the Google Closure Compiler
#!/bin/sh
#_(
"exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@"
)
;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print:
;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}]
(ns datascript-to-datomic-util
(:require [datascript :as d]))
;;;; a utility to help with a datomic-datascript roundtrip process involving:
;;; 1. export some data from a datomic database and transact into a datascript instance.
;;; 2. perform one or more transactions against datascript.
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx
;;; this namespace contains two public functions:
;;; listen-for-changes: listen to datascript transactions and build up a record of changes
@yangshun
yangshun / youtube-vimeo-url-parser.js
Last active June 14, 2023 22:27
YouTube Vimeo URL Parser
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551
@favila
favila / datomic-mysql-bootstrap.sql
Created January 22, 2015 17:49
Better MySQL bootstrap setup for datomic's datomic_kvs table
-- Optimized MYSQL schema for datomic
-- Unfortunately the bin/sql/mysql-*.sql bootstrapping files for datomic are not
-- very good, and can actually cause failures if not adjusted.
-- One symptom of this is the following error:
-- SQL Error (1071): Specified key was too long; max key length is 767 bytes.
-- Reported here: https://support.cognitect.com/entries/28462168-MySQL-Caveats
-- This is caused by the default collation for the `id` column possibly being
@bhb
bhb / README.md
Last active May 15, 2023 01:28
Clojure friendly mode, inspired by https://github.com/slipset/friendly
@arohner
arohner / google-api.clj
Created November 5, 2016 21:53
Clojure example of accessing google APIs directly
(ns example.api.google
(:require [cemerick.url :as url]
[cheshire.core :as json]
[clj-jwt.core :as jwt]
[clj-jwt.key :as key]
[clj-time.core :as time]
[clj-http.client :as http]
[clojure.string :as str])
(:import java.io.StringReader))