Skip to content

Instantly share code, notes, and snippets.

function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
YELLOW="\[\033[1;33m\]"
export PS1="\[\e[36;1m\]\u@\[\e[32;1m\]\H\e[0m:\[\e[0m\]\e[35;1m\w\e[0m $YELLOW\$(parse_git_branch)\[\e[0m\]$ \[\e[0m\]"
YELLOW="\[\033[1;33m\]"
PINK="\[\e[1;35m\]"
GREEN="\[\e[1;32m\]"
BLUE="\[\e[1;36m\]"
PLAIN="\[\e[m\]"
BLACK="\[\e[1;30m\]"
export LSCOLORS="Exfxcxdxbxegedabagacad"
alias ls="ls -G"
public class ModelExample {
public static void main(String[] args) {
ClientManager clientManager = ClientManager.factory(Cassandra.Client.class);
clientManager.addHost("localhost", 9160);
Primitives p = new Primitives();
p.setSomeBoolean(false);
p.setSomeByte(Byte.MAX_VALUE);
p.setSomeChar('a');
p.setSomeDouble(Double.MAX_VALUE);
Comments { // CF - NOT SUPER
uuid_1 : {
title: some title for the comment,
body: this is the body of the commment,
author: some dude
},
uuid_2 : {
title: another title,
body: bla bla,
author: joe balls
hdiutil resize -size 2.6g ~/Desktop/my.dmg
<link href="/pretty/prettify.css" media="all" rel="stylesheet" type="text/css" />
<script src="/pretty/prettify.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function zpad(num, padto) {
var asStr = "" + num;
var numDigits = padto - asStr.length;
var str = "";
<!-- this whole page opens in facebox -->
<div id="#comments">
<!-- comments go here -->
<div id="pagination-stuff">
<a href="/band/comments?page=1">1</a>
<a href="/band/comments?page=2">2</a>
<a href="/band/comments?page=2">3</a>
</div>
<?php
$users = someshit($someVar);
?>
<div class="bla">
<? foreach ($users as $u) : ?>
<div>
<?= $u['username'] ?> from <?= $u['location'] ?>
<? if (is_band($u['id'])) :?>
<?= $u['profile']['genre'] ?>
# create dict from *args
kw = {}
kw.update(dict(zip(func.func_code.co_varnames, args)))
<?php
class UserDataAccessClass
{
/**
* @return int
*/
public function getNumFollowers(string $userID)
{
return valueFromAServiceCallOrQueryEtc($userID)
}