Skip to content

Instantly share code, notes, and snippets.

View galdolber's full-sized avatar

Gal Dolber galdolber

View GitHub Profile
@zerg000000
zerg000000 / user.clj
Last active November 12, 2022 23:03
S3 presign (post) example aws-api
(require '[buddy.core.codecs.base64 :as base64]
'[cognitect.aws.util :as util]
'[clojure.string :as str]
'[jsonista.core :as json]
'[cognitect.aws.credentials :as creds]
'[cognitect.aws.http :as http])
(import '[java.util Date])
(defn host-style-bucket-uri [bucket]
(str "http://" bucket ".s3.amazonaws.com/"))
<?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" => [
@esmcelroy
esmcelroy / _installing_simphony_2.10.md
Last active December 20, 2021 19:12
Installing Oracle/Micros Simphony 2.10

Preparing a Server for Simphony installation, and Installing Oracle/Micros Simphony 2.10

Prerequisites

The following is a list of prerequisites for the successful installation of Oracle Simphony POS 2.10:

  • Windows Server 2012 R2
  • The following IIS and .NET components:
    • NetFx4ServerFeatures
  • NetFx4
@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"]}]
const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@bhb
bhb / README.md
Last active May 15, 2023 01:28
Clojure friendly mode, inspired by https://github.com/slipset/friendly
var config = qz.configs.create("Epson TM88V");
// The QR data
var qr = 'https://qz.io';
// The dot size of the QR code
var dots = '\x09';
// Some proprietary size calculation
var size1 = String.fromCharCode(qr.length + 3);
@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))
@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...";
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 6, 2024 22:10
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.