Skip to content

Instantly share code, notes, and snippets.

View 0b1kn00b's full-sized avatar

0b1kn00b

View GitHub Profile
@codecitizen
codecitizen / list-classes-from-jar.clj
Created November 25, 2018 12:48
How to list all classes from JAR file in Clojure.
(ns list-classes-from-jar
(:import (java.util.jar JarFile)))
(def jar-file (JarFile. "target/s3-file-upload-sls-1.0.0-SNAPSHOT-standalone.jar"))
(def entries (.entries jar-file))
(while (.hasMoreElements entries)
(let [entry (.nextElement entries)]
(println (.getName entry))))
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active June 23, 2025 02:11
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.org/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  • JSONL → JSON

@dimitardanailov
dimitardanailov / create_user.sh
Last active August 9, 2023 06:16
Creating a Mac OS X user via shell script
#!/bin/sh
# https://apple.stackexchange.com/questions/82472/what-steps-are-needed-to-create-a-new-user-from-the-command-line/84039#84039
. /etc/rc.common
dscl . create /Users/administrator
dscl . create /Users/administrator RealName "Terminal User Account"
dscl . create /Users/administrator hint "Password Hint"
dscl . create /Users/administrator picture "/Path/To/Picture.png"
dscl . passwd /Users/administrator thisistheaccountpassword
@kachayev
kachayev / logic.py
Last active July 31, 2022 12:26
Lazy developer's approach to do exercises on Propositional Logic
# -*- coding: utf-8 -*-
from tabulate import tabulate
class Var(object):
def __init__(self, name):
self.name = name
self.value = None
def bind(self, value):
@joepie91
joepie91 / .md
Last active February 25, 2025 21:32
A *complete* listing of operators in Nix, and their predence.

Lower precedence means a stronger binding; ie. this list is sorted from strongest to weakest binding, and in the case of equal precedence between two operators, the associativity decides the binding.

Prec Abbreviation Example Assoc Description
1 SELECT e . attrpath [or def] none Select attribute denoted by the attribute path attrpath from set e. (An attribute path is a dot-separated list of attribute names.) If the attribute doesn’t exist, return default if provided, otherwise abort evaluation.
2 APP e1 e2 left Call function e1 with argument e2.
3 NEG -e none Numeric negation.
4 HAS_ATTR e ? attrpath none Test whether set e contains the attribute denoted by attrpath; return true or false.
5 CONCAT e1 ++ e2 right List concatenation.
6 MUL e1 * e2 le
@elsassph
elsassph / 0-Example.hx
Last active May 25, 2016 20:04
Haxe - use macro to generate dispatch code
/*
Automatically generate dispatch functions as:
public function onDoubleArguments(one:String, two:Int) {
for (listener in listeners)
listener.onDoubleArguments(one, two);
}
*/
class Example extends Dispatcher<Dynamic>
{
@hstraub
hstraub / gist:8c99470f1de735edb298
Created November 10, 2015 11:55
Firefox web console - load script.js
var script = document.createElement("script");
script.src = "http://whatever.com/js/my/script.js";
document.body.appendChild(script);
@monolithed
monolithed / XML.bnf
Last active October 17, 2022 08:45
# https://raw.githubusercontent.com/aptana/studio2/master/tools/com.aptana.ide.parsing.tools/Parser%20Files/XML.bnf
###
# level 1
###
document
: prolog element Misc*
;
@waneck
waneck / Repl.hx
Last active September 13, 2020 14:04
Very simple Haxe REPL
/*
Copyright (c) 2014 Cauê Waneck
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the <organization>. The name of the
@dpeek
dpeek / gist:7803958
Created December 5, 2013 11:41
Building Haxe for Android
$ mkdir haxe-droid && cd haxe-droid
$ git clone https://github.com/vouillon/ocaml-android.git
$ git clone https://github.com/HaxeFoundation/haxe.git
$ http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86.tar.bz2
$ tar -vjxf android-ndk-r9b-darwin-x86.tar.bz2 && rm android-ndk-r9b-darwin-x86.tar.bz2 && mv android-ndk-r9b android-ndk
$ wget http://caml.inria.fr/pub/distrib/ocaml-4.01/ocaml-4.01.0.tar.gz
$ tar -xzf ocaml-4.01.0.tar.gz && rm ocaml-4.01.0.tar.gz && mv ocaml-4.01.0 ocaml-src