Skip to content

Instantly share code, notes, and snippets.

View OneOfOne's full-sized avatar
🐧
Focusing

Ahmed W. OneOfOne

🐧
Focusing
View GitHub Profile
@OneOfOne
OneOfOne / interface_vs_type_test.go
Created April 1, 2014 20:39
Benchmarking interface{} vs typed parameters.
package main
import (
"testing"
"sync/atomic"
)
func sumI(nums... interface{}) interface{} {
var s uint64
for _, n := range nums {
<?php
/**
* Plugin Name: OneOfOne's NoSpam
* Plugin URI: http://limitlessfx.com/php/nospam-wp
* Description: Simple transparent no-spam plugin
* Version: 0.4
* Author: OneOfOne
* Author URI: http://limitlessfx.com/
* License: Apache-2
*/
package main
import (
"fmt"
"unsafe"
)
//#include "xxhash_9p.c"
//import "C" //uncomment this and comment the next line for the cgo version
func XXH32_test(in unsafe.Pointer, l uint32, seed uint32) uint32
@OneOfOne
OneOfOne / .vimrc
Created September 15, 2014 15:08
vimgo-vimrc
set nocompatible
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'bling/vim-airline'
@OneOfOne
OneOfOne / .jsbeautifyrc
Created February 3, 2015 23:47
HTML-CSS-JS Prettify settings
{
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"],
"brace_style": "collapse",
"end_with_newline": true,
"indent_char": "\t",
"indent_handlebars": false,
"indent_inner_html": false,
"indent_scripts": "keep",
"indent_size": 1,
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
"strings"
"time"
)
@OneOfOne
OneOfOne / wnew.sh
Created December 4, 2011 12:20
Arch32D's wine launcher script.
#!/bin/bash
IFS=$(echo -en "\n\b")
if [ -e /opt/arch32 ]; then
CDIR="$(pwd)" arch32 $0 ${@}; exit
else
if [ -d "$CDIR" ]; then
cd "$CDIR"
fi
unset CDIR
@OneOfOne
OneOfOne / sftpput.sh
Last active March 4, 2016 15:10
scp replacement using sftp because scp is a horrible piece of crap.
#!/bin/sh
#
# this script is under public domain, go nuts.
# originally posted by OneOfOne at https://gist.github.com/OneOfOne/6598fd2f79145200b512
#
if [ "$#" -lt 2 ]; then
echo "usage: $0 files... [sftp args] host:/path" > /dev/stderr
exit 1
@OneOfOne
OneOfOne / git-push-new
Created March 9, 2016 21:26
git push-new: pushes a new branch to remote and creates a pull request (uses hub)
#!/bin/sh
BRANCH=$(git symbolic-ref --short HEAD)
if echo $BRANCH | grep -q master; then
echo no master pushing
exit 1
fi
if git remote show -n origin | grep -q $BRANCH; then
git push "$@"
else
@OneOfOne
OneOfOne / client.conf
Last active March 18, 2016 19:47
a little script to handle connecting to an openvpn server and executing commands on top of that connection.
client
dev tun
proto udp
remote remote-server.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/pki/ca.crt
cert /etc/openvpn/pki/issued/myclienthost.crt