Skip to content

Instantly share code, notes, and snippets.

View dantheobserver's full-sized avatar
🤖
I have a mission

dantheobserver dantheobserver

🤖
I have a mission
View GitHub Profile
@vinarmani
vinarmani / bitcoindrm.js
Last active April 14, 2022 23:42
Quick and dirty DRM for JPEGs leveraging ECIES (encryption and decryption) with Bitcoin private and public keys - Node.js
const fs = require('fs');
const eccryptoJS = require('eccrypto-js');
const coinkey = require('coinkey');
const convertToEncryptStruct = (encbuf) => {
let offset = 0;
let tagLength = 32;
let pub;
switch(encbuf[0]) {
case 4:
@cstby
cstby / cider-eval-n-defuns.md
Last active January 17, 2022 23:12
Faster feedback in Clojure with `cider-eval-n-defuns`.

Summary

You can use this Emacs function to easily evaluate multiple top-level forms in Clojure using CIDER.

(defun cider-eval-n-defuns (n)
  "Evaluate N top-level forms, starting with the current one."
  (interactive "P")
  (cider-eval-region (car (bounds-of-thing-at-point 'defun))
                     (save-excursion
 (dotimes (i (or n 2))
@mskorzhinskiy
mskorzhinskiy / ricing.el
Created September 1, 2020 09:31
Doom emacs org-mode ricing
;; Font
(setq doom-font "Iosevka-9")
;; Hide signs like "~" or "_" or "*"
(setq org-hide-emphasis-markers t)
;; Don't align tags
(setq org-tags-column 0)
;; Increase indenation in org-indent
@AllenDang
AllenDang / gccemacs.md
Last active July 7, 2024 09:42
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.
@romgapuz
romgapuz / pickle2json.py
Created May 18, 2020 07:26
Tool for converting Pickle to JSON using this simple Python Command Line program
"""
Pickle2JSON is a simple Python Command Line program for converting Pickle file to JSON file.
Arguments: Only one (1) argument is expected which is the pickle file.
Usage: python pickle2json.py myfile.pkl
Output: The output is a JSON file bearing the same filename containing the JSON document of the converted Pickle file.
"""
# import libraries
import pickle
@polymeris
polymeris / core.cljs
Last active June 24, 2023 03:39
re-frame + reagent + figwheel app running in the console
(ns hello-react-blessed.core
(:require
[cljs.nodejs :as nodejs]
[reagent.core :as reagent]
[re-frame.core :as rf]
[blessed :as blessed] ; or use neo-blessed
["react-blessed" :as rb]
[ws]))
(defonce logger (reagent/atom []))
@mfikes
mfikes / round-trip.md
Last active July 25, 2018 21:56
Copy and paste data

In the last bit in this REPL sequence, I want the negative and positive square root of 2 in a vector. So, I copy the ratio and paste it into a form.

$ clj
Clojure 1.9.0
user=> (require '[com.gfredericks.exact :as e])
nil
user=> (def TWO (e/native->integer 2))
#'user/TWO
user=> (defn square [x] (e/* x x))
@rstacruz
rstacruz / README.md
Last active November 11, 2020 09:00
Prettier-eslint on Spacemacs

Setting up automatic Eslint formatting on Spacemacs

Note: This assumes that your project already has a working eslint setup!

Step 1: add prettier-eslint_d

prettier-eslint_d is a "daemon" versions of prettier and eslint. They are faster frontends to prettier and eslint, great for editors. Add it to your project via Yarn:

# prettier-eslint_d are replacements for these packages; if you have them,
@borkdude
borkdude / README.md
Last active June 4, 2022 02:26
CLI app with ClojureScript on Node

First install clojure so the clj command will be available.

brew install clojure

Clone and move core.cljs to the right directory:

git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
@mfikes
mfikes / README.md
Last active March 8, 2019 12:11
cljs.main rebel-readline

Start cljs.main with rebel-readline:

clojure -Sdeps '{:deps {github-mfikes/cljs-main-rebel-readline {:git/url "https://gist.github.com/mfikes/9f13a8e3766d51dcacd352ad9e7b3d1f" :sha "27b82ef4b86a70afdc1a2eea3f53ed1562575519"}}}' -i @setup.clj -m cljs.main