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 / 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 / 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 / settings.json
Last active November 11, 2016 19:44
vscode config (1.8.0-insider update)
{
"editor.fontFamily": "Fira Code Medium",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.tabSize": 4,
"editor.insertSpaces": false,
"editor.quickSuggestionsDelay": 50,
"editor.renderWhitespace": "boundary",
"editor.stablePeek": true,
"editor.glyphMargin": true,
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
"strings"
"time"
)
@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,
@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'
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 / xxhash_map_test.go
Created July 27, 2014 09:56
Go map[string] vs xxhash map[uint64]
package xxhash_map_test
import (
"bytes"
"fmt"
"testing"
"github.com/OneOfOne/xxhash"
)
<?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
*/
@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 {