Skip to content

Instantly share code, notes, and snippets.

Gal Dolber galdolber

Block or report user

Report or block galdolber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wehatecaptchas.php
$captchaVerification = !empty($_REQUEST["captcha_verification"]) ? $_REQUEST["captcha_verification"] : false;
if ($captchaVerification !== false) {
$data = [
"endpoint" => "verify",
"captcha_verification" => $captchaVerification,
"captcha_difficulty" => 5 // make sure the difficulty matches the diffulty you added to form button
$options = [
"http" => [
borkdude / js_parser.clj
Last active Sep 7, 2019
Parse JavaScript in Clojure using the Google Closure Compiler
View js_parser.clj
"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"]}]
View console-colors.js
const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
bhb /
Last active Apr 2, 2019
Clojure friendly mode, inspired by
Arinerron /
Last active Jan 24, 2020
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
# Give the usual warning.
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
Rich-Harris /
Last active Jan 26, 2020
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

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.

maxweber / query_check.clj
Created May 13, 2016
Checks if a Datomic datalog query contains only allowed symbols / functions.
View query_check.clj
(require '[datomic.api :as d]
'[clojure.string :as str])
(defn normalize-query
"Turns a vector formatted Datomic datalog query into a map formatted
(let [pairs (partition-by keyword? query)]
(assert (even? (count pairs)))
View datascript-to-datomic-util.cljs
(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
favila / datomic-mysql-bootstrap.sql
Created Jan 22, 2015
Better MySQL bootstrap setup for datomic's datomic_kvs table
View datomic-mysql-bootstrap.sql
-- 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:
-- This is caused by the default collation for the `id` column possibly being
aphyr / gist:f72e72992dade4578232
Last active Dec 17, 2016
Clojure Keyword.intern
View gist:f72e72992dade4578232
commit 8e51c34ca4d97e48750850d5ba09956f89783b4e
Author: Kyle Kingsbury <>
Date: Wed May 7 19:06:15 2014 -0700
Improve Keyword.intern performance
Keyword interning is an expensive factor in many Clojure
serialization/deserialization paths, especially where the same set of
keywords are created and freed repeatedly; e.g. iterating over records
with similar structure. There are two principle costs to keyword
You can’t perform that action at this time.