Skip to content

Instantly share code, notes, and snippets.

View mhaidarhanif's full-sized avatar
🧊
developing people and software

M Haidar Hanif mhaidarhanif

🧊
developing people and software
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provision "shell", path: "vagrant-android-build.sh"
config.vm.provider :virtualbox do |vb|
@doublejosh
doublejosh / omghosts
Last active August 29, 2015 13:59 — forked from angrytoast/omghosts
Never accidentally leave your /etc/hosts file edited again!!! Let your computer remind you.
#! /usr/bin/env bash
GOLDEN_DOMAIN="example.com"
PROBLEM="$(cat /etc/hosts | grep $GOLDEN_DOMAIN | grep -v '^#' | wc -w)"
if [ "$PROBLEM" -gt 0 ]; then
say omg fix yer hosts
fi
@alanorth
alanorth / gogs-ubuntu-14.04.md
Last active August 29, 2015 14:03
Configuring gogs.io in an Ubuntu 14.04 VM

Gogs.io on Ubuntu 14.04

Create the VM

Create a VM using virt-install and feed it a preseed.

$ sudo virt-install --name gogs --ram 1024 --vcpus=1,cpuset=3 --cpu host --disk path=/home/aorth/software/vms/gogs.qcow2,size=40,bus=virtio,format=qcow2 --bridge=br0 --os-variant ubuntusaucy --location http://ubuntu.mirror.ac.ke/ubuntu/dists/trusty/main/installer-amd64 --graphics vnc -x "auto=true priority=critical url=http://192.168.5.3/~aorth/preseed/gogs.cfg"

You will have to configure the network manually (you can't set the network configuration in the preseed when using a network-based preseed, apparently).

Add users

@did
did / devise.rb
Created February 23, 2015 15:13
devise file generated by locomotive
# Use this hook to configure devise mailer, warden hooks and so forth. The first
# four configuration values can also be set straight in your models.
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "please-change-me@config-initializers-devise.com"
@rtgibbons
rtgibbons / post_test.js
Last active October 1, 2015 19:26
mocha test on Keystone Model
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
require('dotenv').load();
var keystone = require('keystone');
var chai = require('chai');
var dbURI = process.env.MONGO_URL
keystone.init({
'name': 'Post Model Test',
's3 config': {} //has to be set, but isn't used in our models
#include <node.h>
namespace cpphello {
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::String;
using v8::Value;
@sjockers
sjockers / gist:4170211
Last active October 13, 2015 08:48
AWE: UIDsgn

Last minute update: We are organizing a hackday! Add your name to the list if you'd like to join us: http://doodle.com/i4g5y6fpcpktrmcr


Description and schedule for the master's seminar "Current trends in web-standards based UI-design" at HTW Berlin

Recent years have seen significant change in the way users engage with the web. With the rapid progress of web standards and browser technology, it has evolved from a platform for hypertext content to an universal runtime environment for applications. Also, the context in which people use the web has changed. The near-ubiquitous availability of internet access has moved the web from the desk to our pockets — to smartphones, tablets and other mobile devices.

Goals and Objectives

@mbleigh
mbleigh / comparison.md
Last active November 4, 2015 04:17
Comparing the features of Divshot and Firebase static web hosting.

Divshot/Firebase Hosting Feature Comparison

Feature Divshot Firebase
Global CDN
Custom Domains
SSL Supported
Command-Line Tools
Simple Rollback
Free w/ Firebase

Disclaimer: This post is Meteor & Backbone beef. Both Meteor and Backbone are absolute genius, and far beyond anything I could dream to create. But IMO there are better tools. Prepare yourselves *gulp*, I need to get this off my chest.

First, Backbone. Why people? It revolutionized JavaScript, did wonderful things for the world, and served its purpose well. But now we have better tools, so let’s move on. It’s like Gentoo users proselytizing Gentoo to the masses, perpetuating it as most common Distro; where all this time, Ubuntu would have saved everyone countless hours. Not

@alexyoung
alexyoung / tmux.conf
Created July 19, 2013 16:12
tmux cheap powerline
#!/usr/bin/env sh
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%\n", $10/$5 * 100)}'