Skip to content

Instantly share code, notes, and snippets.

View underhilllabs's full-sized avatar

Bart Lantz underhilllabs

View GitHub Profile
@ficusk
ficusk / GsonRequest.java
Last active April 9, 2024 09:03
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@matstani
matstani / handler.clj
Last active December 14, 2015 09:19
Compojureでファイルアップロード
(ns helloworld.handler
(:use compojure.core)
(:require [clojure.java.io :as io]
[ring.util.response :as response]
[compojure.handler :as handler]
[compojure.route :as route]
[hiccup.form :as form]
[hiccup.core :refer [html]]))
;; ページレイアウト
@thomaspark
thomaspark / subnav.css
Last active June 6, 2023 10:19
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
@anchetaWern
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@peterc
peterc / backwards.txt
Created November 26, 2012 23:08
Reading
I'm a Rubyist with a lot of admiration for Python. Both languages are
similar (in the grand scheme of things) and each has huge pros and cons.
Python does not click for me in the same way as Ruby does not
click for perhaps the majority of programmer-kind. German doesn't click
for me either and 100m+ people speak that ;-) But I recently saw an
example of WHY Python taxes my Ruby brain a little.
I found some code at http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@underhilllabs
underhilllabs / include_math.md
Created May 20, 2012 20:40
gcc #include <math.h>

from gcc FAQ

gcc faq

14.3: I'm trying to do some simple trig, and I am #including <math.h>, but I keep getting "undefined: sin" compilation errors.

A: Make sure you're actually linking with the math library. For instance, due to a longstanding bug in Unix and Linux systems, you usually need to use an explicit -lm flag, at the end of

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@mislav
mislav / aprompt.png
Last active February 11, 2024 06:40
My zsh prompt. No oh-my-zsh needed
aprompt.png
@caleywoods
caleywoods / gist:1197657
Created September 6, 2011 14:15
CentOS install
#!/usr/bin/env bash
echo "Checking for SSH key, generating one if it exists ..."
[[ -f ~/.ssh/id_rsa.pub ]] || ssh-keygen -t rsa
echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/id_rsa.pub ]] && cat ~/.ssh/id_rsa.pub | xclip
open https://github.com/account/ssh
echo "Using yum to install OS packages so let's update it first ..."