Skip to content

Instantly share code, notes, and snippets.

@unjello
unjello / ob-io.el
Created January 21, 2012 12:45
org-babel functions for Io evaluation
;; this is a part of org-mode package now. please visit: http://orgmode.org/
(defun unj-c-stringify (αbegin αend)
"Surround current line or each line in region with quotes and escape ones inside
based on Xah Lee http://ergoemacs.org/emacs/elisp_escape_quotes.html
v2016-06-08"
(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-end-position))))
(save-excursion
(save-restriction
@unjello
unjello / Unj-GitCloneAll.ps1
Last active October 6, 2016 11:35
Git clone all repositories of a user
function Unj-GitCloneAllBy($User, $Proxy = $null) {
(curl -Proxy $Proxy "https://api.github.com/users/$User/repos?page=1&per_page=100").Content
| ConvertFrom-Json
| %{ $_.clone_url }
# workaround git printing to stderr by @wekempf aka William Kempf
# https://github.com/dahlbyk/posh-git/issues/109#issuecomment-21638678
| %{ & git clone $_ 2>&1 }
| % { $_.ToString() }
}
@unjello
unjello / compile_dosbox.sh
Created December 2, 2017 13:06
macOS: compile and install dosbox
#!/usr/bin/env sh
brew install autoconf automake sdl sdl_net sdl_sound zlib libpng ncurses
svn co http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk/ dosbox
cd dosbox
./configure --enable-debug --enable-core-inline
make
make install
### Keybase proof
I hereby claim:
* I am unjello on github.
* I am unjello (https://keybase.io/unjello) on keybase.
* I have a public key ASCtGhVRgl9dDsfOgqx2o9IVtpZNVAYVL8emdMqn1To58Qo
To claim this, I am signing this object:
@unjello
unjello / FixProxy.ps1
Last active December 18, 2018 07:36
Powershell to fix corporate proxy and SSL issues with certain tools
(New-Object System.Net.WebClient).Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls -bor [System.Net.SecurityProtocolType]::Ssl3
@unjello
unjello / ffmpeg.txt
Created January 1, 2019 16:31
ffpmeg cheatsheet
; concat multiple avi files. create "list.txt" with "file xxx.avi" per line
ffmpeg -f concat -safe 0 -i list.txt -c copy out.avi
This file has been truncated, but you can view the full file.
Compiling memchr v2.3.3
Compiling glob v0.3.0
Compiling lazy_static v1.4.0
Compiling libc v0.2.74
Compiling proc-macro2 v1.0.19
Compiling regex-syntax v0.6.18
Compiling unicode-xid v0.2.1
Compiling winapi v0.3.9
Compiling syn v1.0.38
Compiling jobserver v0.1.21
#/bin/bash
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
# clang-10
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main"
sudo apt install -y clang-10 clang-tools-10 clang-10-doc libclang-common-10-dev libclang-10-dev libclang1-10 clang-format-10 python3-clang-10 clangd-10 libfuzzer-10-dev lldb-10 lld-10 libc++-10-dev libc++abi-10-dev
# clang-11
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main"