Skip to content

Instantly share code, notes, and snippets.

View 0b1kn00b's full-sized avatar

0b1kn00b

View GitHub Profile
@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*
;
@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);
@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>
{
@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
@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):
@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
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active October 15, 2025 22:47
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

@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))))
@Yanrishatum
Yanrishatum / hlc.md
Last active September 25, 2025 22:49
How to compile HL/C

How to compile HL/C

Prepwork/terms

Because I have no trust in people.

  • <hashlink> points to your installation of Hashlink, e.g. folder in which hl.exe (or Unix executable) is, alongside with library binaries (.hdll files), and include folder.
  • <src> points to the folder containing generated HL/C sources. One that contains hlc.json file.
  • <app> refers to your output executable name, including extension.
  • <main> refers to your entry-point file name, including extension (see below).
  • I provide example of doing it on Windows via MSVC cl.exe, but Unix should be more or less same with replacement of argument flags and compiler.
  • I expect that you DO have a compiler installed and can call cl.exe or other compiler from command-line.
@573
573 / readme.md
Last active January 20, 2024 21:02
nix complains "error: cannot auto-call a function that has an argument without a default value ('stdenv')"?

Add on top of default.nix: with import {}; or simply run as nix-build '' (i. e. for nix-build complaining) or rather nix-build -E 'with import {}; callPackage ./default.nix {}' (or even import)