Skip to content

Instantly share code, notes, and snippets.

View bbkane's full-sized avatar
🤜

Benjamin Kane bbkane

🤜
View GitHub Profile
#include <stdio.h>
#include <fcntl.h>
#if defined(__unix__) || defined (__CYGWIN__)
#include <unistd.h>
#else
#include <io.h>
#endif
#ifndef O_BINARY
@kesor
kesor / Gemfile
Last active September 30, 2019 09:04
Vagrantfile to create a chef-server (11.x) and a client box that uses it.
source :rubygems
gem 'json', '= 1.5.4' # knife/chef 11.0 and 11.20 is broken with json 1.5.5/1.7.7
gem 'vagrant'
gem 'vagrant-hostmaster'
@bbarad
bbarad / crouton_setup.sh
Last active February 26, 2020 17:03
Set up Precise with i3-wm on an Asus C200 using crouton
# Must have already entered dev mode to use this shell script from a crosh shell.
wget -O ~/Downloads/crouton http://goo.gl/fd3zc
sudo sh -e ~/Downloads/crouton -t x11,audio,keyboard,extension -n i3precise
# This takes 15-20 minutes.
sudo enter-chroot -n i3precise
@snoyberg
snoyberg / .emacs
Last active June 5, 2021 23:04
Michael Snoyman's .emacs file: Stack, haskell-mode, evil-mode
;; Get package installation ready
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; Theme
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'zenburn t)
gotest() {
go test $* | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' | GREP_COLOR="01;33" egrep --color=always '\s*[a-zA-Z0-9\-_.]+[:][0-9]+[:]|^'
}
@llimllib
llimllib / Makefile
Last active March 20, 2022 20:08
The simplest possible use of esbuild to import a package and run a function in the browser
build:
./node_modules/.bin/esbuild index.js --bundle --outfile=out.js
@kirang89
kirang89 / model_relation_ex.py
Created April 7, 2014 18:59
Example for many-to-many relationship with extra columns in SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = declarative_base()
@adrianbrad
adrianbrad / .golangci.yaml
Last active March 22, 2023 12:30
golangci-lint strict config file
# .golangci.yml
run:
modules-download-mode: vendor
skip-dirs: [vendor]
linters-settings:
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.19"

Core Coding Standard

Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.

Table Of Contents

@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim