Skip to content

Instantly share code, notes, and snippets.

@Jannis
Jannis / build.clj
Last active May 6, 2020 10:47
Using GraphQL / Apollo Client / React Apollo in the next ClojureScript release
;; Run using a local build of ClojureScript master, e.g.:
;; clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.155"}}}' -i build.clj
(require '[cljs.build.api :as b])
(b/watch "src"
{:output-dir "out"
:output-to "out/main.js"
:optimizations :none
:verbose true
@carlgieringer
carlgieringer / integration-request.vtl
Last active June 14, 2022 05:30
AWS API Gateway Integration Request Lambda Proxy (LAMBDA_PROXY) Velocity Template Language (VTL)
## MIT License
##
## Copyright (c) 2017 Carl Gieringer
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
@d2rk
d2rk / build.sh
Created December 4, 2016 11:37
dlib for AWS lambda
$ wget --no-check-certificate -P /tmp http://flydata-rpm.s3-website-us-east-1.amazonaws.com/patchelf-0.8.tar.gz
$ tar xvf /tmp/patchelf-0.8.tar.gz -C /tmp
$ cd /tmp/patchelf-0.8 && ./configure && make && sudo make install
$ sudo yum install -y blas-devel boost-devel lapack-devel gcc-c++ cmake python-devel git
$ git clone https://github.com/davisking/dlib.git
$ cd dlib/python_examples/
$ mkdir build && cd build
$ cmake -D USE_SSE4_INSTRUCTIONS:BOOL=ON ../../tools/python
$ cmake --build . --config Release --target install
@aputs
aputs / jwt.cljs
Created September 21, 2016 02:01
clojurescript JWT encode/decode (SHA version only)
(ns cljsjs.jwt
(:require
[clojure.spec :as s]
[clojure.string :as str]
[goog.json :as json]
[goog.crypt.base64 :refer [encodeString decodeString]]))
;; https://github.com/Caligatio/jsSHA
;; goog.crypt.hmac produces different signature than nodejs version
(def jssha (js/require "jssha"))
@kevinpapst
kevinpapst / flash-android-rom-with-heimdall-on-mac.md
Last active February 19, 2023 23:24
Flash a new Android ROM on Mac with ADB and Heimdall

Installing an Android ROM with your Mac via Heimdall and bash

Because every time I want to flash a new ROM, I forgot how I did it the last time.

This is how I re-flashed my unbranded Samsung Galaxy S4 (german black edition) with a stock ROM (because Cyanogenmod crashed my phone all the time). The correct Stock ROM for my Galaxy S4 is: I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2

Software you need

  • adb
  • heimdall (brew cask install heimdall-suite)
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 23, 2024 06:59
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@andrewsuzuki
andrewsuzuki / analytics.cljs
Last active December 8, 2019 15:31
clojurescript google analytics autotrack
(ns MY_NAMESPACE.analytics
(:require [cljsjs.google-analytics]
[autotrack]))
(def tracking-code "UA-XXXXX-Y")
(defn start []
(js/ga "create" tracking-code "auto")
(js/ga "require" "autotrack")
(js/ga "send" "pageview"))
@bufke
bufke / document_to_text.py
Last active May 28, 2023 13:31
Convert odt, doc, docx, pdf to text with python and some linux programs. Doesn't require Libreoffice.
from subprocess import Popen, PIPE
from docx import opendocx, getdocumenttext
#http://stackoverflow.com/questions/5725278/python-help-using-pdfminer-as-a-library
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from cStringIO import StringIO
@rvagg
rvagg / README.md
Last active May 4, 2024 12:17
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname