Skip to content

Instantly share code, notes, and snippets.

View disruptek's full-sized avatar
🧹
aspiring janetor

Smooth Operator disruptek

🧹
aspiring janetor
View GitHub Profile
@disruptek
disruptek / direct_tty.ss
Created February 12, 2022 04:42 — forked from clartaq/direct_tty.ss
Raw Terminal Input in Chez Scheme
;;
;; direct_tty.ss
;;
;; This is a demonstration program using some of the Chez Scheme FFI to put the
;; terminal into "raw" mode, read a line of characters, possibly containing
;; control characters that would normally terminate input, without echoing
;; the characters typed. Once the user presses the line termination character,
;; (user defined), the program displays the line.
;;
;; The program shows how to obtain character-by-character input with
@disruptek
disruptek / languages-and-vms.md
Created October 22, 2020 21:05 — forked from haxscramper/languages-and-vms.md
languages-and-vms

Language & VM design

Lexing & parsing

Writing own parser

  1. nimly - Lexer Generator and Parser Generator as a Library in Nim.

    With nimly, you can make lexer/parser by writing definition in formats like lex/yacc. nimly generates lexer and parser by using macro in compile-time, so you can use nimly not as external tool of your program but as a library.

@disruptek
disruptek / meow.nim
Created August 7, 2020 21:55 — forked from genotrance/meow.nim
Nim wrapper for meow hash using nimterop
import strutils
import nimterop/[build, cimport]
const
baseDir = getProjectCacheDir("meow")
static:
gitPull(
"https://github.com/cmuratori/meow_hash",
@disruptek
disruptek / quickjs.nim
Created July 15, 2020 16:57 — forked from genotrance/quickjs.nim
Nim wrapper for quickjs using nimterop
# nim c -d:FLAGS quickjs.nim
#
# FLAGS
# -d:quickjsGit
# -d:quickjsSetVer=
# -d:quickjsStatic
import os
import nimterop/[build, cimport]
@disruptek
disruptek / travis.sh
Last active May 21, 2020 14:17
another travis config
#! /bin/bash
export GITBIN=$HOME/bin
mkdir -p $GITBIN
export PATH=$HOME/Nim/bin:$HOME/nimph:$GITBIN:$PATH
if ! type -P git &> /dev/null; then
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export EXT=.exe
@disruptek
disruptek / aws.nim
Created January 9, 2020 23:06 — forked from Varriount/aws.nim
AWS Request Signing for Nim. Requires the `nimcrypto` package.
import strutils
import tables
import algorithm
import httpcore
import unicode
import strformat
import times
import nimcrypto
import httpclient
import utils
@disruptek
disruptek / .travis.yml
Created December 18, 2019 02:54 — forked from genotrance/travis.sh
Travis CI setup for Nim
os:
- windows
- linux
- osx
language: c
env:
- BRANCH=0.19.6
- BRANCH=0.20.2
@disruptek
disruptek / org-syntax-cheatsheet.org
Created July 29, 2019 14:30 — forked from wdkrnls/org-syntax-cheatsheet.org
Org-mode Syntax Cheat sheet

Markup Cheat sheet for Org-mode

Heading 1

Heading 2: Set a deadline and a schedule

[66%] Heading 3: a list with checkboxes

  1. [X] task 1
  2. [X] task 2
  3. [ ] task 3
@disruptek
disruptek / WeaponizedPyObject.cs
Created June 28, 2018 21:52
An extremely dangerous extension of PyObject
/* A weaponized version of PyObject.
*
* This code violates multiple tenets of the Geneva Conventions[0]
* the Kyoto Protocol, the United Nations Charter, the Ottawa Treaty,
* the Roerich Pact, both the first and second London Naval Treaties,
* the St. Petersburg Declaration, and the Nuremberg Priciples. It
* may be even run afoul of a few loosely-interpreted sections of the
* Paris Climate Accord due to ambiguity in the Farsi translation[1].
*
* As such, users may be deemed a terrorist threat in (at time of
@disruptek
disruptek / progressive.index.installation
Created July 11, 2017 22:00
example of progressive index installation/enablement with inspection so you can confirm behavior
graph = JanusGraphFactory.open("conf/gremlin-server/janusgraph-cassandra-es-server.properties")
prop = 'some_property_name'
name = 'by' + prop
size = graph.getOpenTransactions().size()
if(size>0) {for(i=0;i<size;i++) {graph.getOpenTransactions().getAt(0).rollback()}}
graph.getOpenTransactions()
m = graph.openManagement()