Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@apokalyptik
apokalyptik / gist:5952215
Created July 8, 2013 20:28
Super simple and informative exmple of using CGO
package main
// #include <ctype.h>
import "C"
import "log"
func main() {
for i := 32; i<126; i=i+1 {
log.Printf( "'%s' (%3d) isalpha: \t%d", string(byte(i)), i, C.isalpha(C.int(i)) )
}
@apokalyptik
apokalyptik / uni.py
Last active December 25, 2015 19:49
#!/usr/bin/python
import re
import unicodedata
import codecs
import urllib2
if 2 == len( u'\U0001f4a9' ):
length_ucs2 = len
else:
@apokalyptik
apokalyptik / uni.py
Last active December 25, 2015 19:49
#!/usr/bin/python
import re
import unicodedata
lm = re.compile("^[0-9a-fA-F]")
s = u""
# http://www.unicode.org/Public/5.2.0/ucd/NamesList.txt
@apokalyptik
apokalyptik / 1 - setup the virtual machines
Last active January 26, 2017 18:06
Installing jobs system from scratch by itself on Debian 8.
2x Debian 8
- 2GB Ram
- 20GB disk
- selected: SSH server, and Standard Utilities
jobs1.test.local
eth0 - bridged, configured 10.0.1.12 (change depending on your network)
eth1 - lan, configured to 192.168.0.1 (change to suite your liking)
jobs2.test.local
#!/usr/bin/env php
<?php
define( 'DEBUG_RECURSION', false );
if ( $_SERVER['argc'] > 1 ) {
if ( substr( $_SERVER['argv'][1], 0, 1 ) !== "/" ) {
define( 'FUNCTION_MATCH', "/" . preg_quote( $_SERVER['argv'][1] ) . "/" );
} else {
define( 'FUNCTION_MATCH', $_SERVER['argv'][1] );
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"os"
)
@apokalyptik
apokalyptik / .vimrc
Last active October 5, 2017 02:47
My .vimrc file
" Instructions:
" 1. Download this .vimrc file:
" curl https://gist.githubusercontent.com/apokalyptik/fdf050e2dd004b756d2e1a0b6f2d399a/raw/.vimrc > .vimrc
" 2. Install vundle:
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" 3. Run vim
" 4. Install Plugins:
" :PluginInstall
" 5. Exit vim

About this document

This will tell you how to use your iPhone as a webcam input source on your Mac (running OSX) for web based video conferencing apps such as WhereBy and VirtualEDH

So... How absurd is this setup? Well here in the opening of 2020 with the pandemic drying up the market for cheap webcams... it's a lot less absurd now than it would have been 3 months ago, and probably a lot more absurd after that whole thing clears up. Right now finding a webcam can be difficult.

Phase 1: Install Software

On your iPhone

Download a full screen camera app. I used FullScreeen which cost me one dollar in app to buy pro as an IAP

@apokalyptik
apokalyptik / decrypt.go
Created September 1, 2014 22:36
Go RSA private key decryption example. Compatible with data encrypted via http://us3.php.net/openssl_public_encrypt
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
@apokalyptik
apokalyptik / bash.face.sh
Last active March 16, 2022 14:45
fun, crazy, little bash prompt
#!/bin/bash
function my_custom_prompt {
ECODE=$?
local HAPPYF=( "('◡')" '(•‿•)' '(˘‿˘)' '(^‿^)' )
local SADF=( '(⊙‸⊙)' '(⊙_☉)' '(o_O)' )
local BLACK="\[\033[0;30m\]"
local LBLACK="\[\033[0;90m\]"