Skip to content

Instantly share code, notes, and snippets.

View nyaray's full-sized avatar
💭
Keeping it real, like floats and doubles

Emilio Nyaray nyaray

💭
Keeping it real, like floats and doubles
View GitHub Profile
@nyaray
nyaray / gist:955432
Created May 4, 2011 15:37 — forked from jakearchibald/gist:955241
OCD in action
.whatever {
-webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.5) inset;
-moz-box-shadow: 0 2px 2px rgba(0,0,0,0.5) inset;
-o-box-shadow: 0 2px 2px rgba(0,0,0,0.5) inset;
box-shadow: 0 2px 2px rgba(0,0,0,0.5) inset;
}
@nyaray
nyaray / EPIC_RAINBOW_DEMO.js
Created March 26, 2012 21:54
Simple inheritance demonstration in Javascript
// A "class"
function MyEpicEntity(name)
{
if(name)
{
this.name = name;
}
this.epic = true; // obvsly...
}
@nyaray
nyaray / gist:2571602
Created May 1, 2012 21:34
Ugly hack to do `git status` in sub-folders (not dependencies, though!) containing git repositories.
# OMG I NEVER WANT TO LOSE THIS.
for dir in `find . -type d | grep -v "deps" | grep ".git$"`; do (cd $dir/..; echo $dir; git status --short); done
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%F{red}●%f "
ZSH_THEME_GIT_PROMPT_CLEAN=""
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(parse_git_dirty)%F{blue}$(current_branch)%f$ZSH_THEME_GIT_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%F{yellow}✗%f "
if [ $UID -eq 0 ]; then
NCOLOR="red";
PCHAR="#";
else
NCOLOR="green";
@nyaray
nyaray / gist:2901653
Created June 9, 2012 16:20
Partial 1
gather_calls(Term) when is_list(Term) ->
gather_calls(hd(Term), tl(Term), []);
gather_calls(_) ->
[].
%% gather_calls(Term, Queue, CallMapAcc)
gather_calls([], [], CallMap) ->
lists:reverse(lists:flatten(CallMap));
gather_calls([], Queue, CallMap) ->
gather_calls(hd(Queue), tl(Queue), CallMap);
@nyaray
nyaray / .vimrc
Created July 27, 2012 10:26
Basic vim-settings.
" Making le sense
set encoding=utf-8
" File things
set backupdir=~/.vim/backup
set swapfile
set dir=~/.vim/temp
" Behaviour
set nocompatible
@nyaray
nyaray / Horrible API.php
Created October 12, 2012 12:33
A 3rd party.
<?php
$objs = serve_request();
echo $PREFIX;
for($obj in $objs) {
retarded_obj_to_xml_function($obj);
waste_cpu_cycles();
}
echo $SUFFIX;
?>
@nyaray
nyaray / gist:3940220
Created October 23, 2012 17:30
Martin-notes
dir(objekt) -> [alla metoder o fält i objekt]
help(objekt|typ) -> man-sida
tex help(str)
(eller dir(str))
dir är lite mer kompakt om man vet vad man letar efter
help är när man inte vet :P
also, in-operatorn
1 in [1,2,3] ==> true
'lolboll' in {'lolboll':'ohai'} ==> true

erm-tools, 2012-10-27

Notes from a starting... erm (no pun intended), meeting.

Rebar mistakes

  • No documentation
  • Making it an escript
  • Packaging it with every erlang app
  • Not recording anything previously completed