Skip to content

Instantly share code, notes, and snippets.

@gabrielpoca
gabrielpoca / fn.zsh
Last active June 1, 2016 17:21
Wait for the CI
# I'm using git as an alias for hub
# wait for the CI to finish and print the result
wait_for_ci() {
while [ "$(git ci-status)" == "pending" ]; do sleep 4; done; git ci-status
}
# or wait for the CI but play some music instead
wait_for_ci() {
while [ "$(git ci-status)" == "pending" ]; do sleep 4; done; radio 3
@gabrielpoca
gabrielpoca / airline-formtter.vim
Last active April 22, 2016 08:42
An airline formatter for the tabline that replaces files called index.js by folder/index.js
function! airline#extensions#tabline#formatters#folder#format(bufnr, buffers)
let name = bufname(a:bufnr)
let folder = fnamemodify(name, ':p:h:t')
let file = fnamemodify(name, ':t')
if fnamemodify(name, ':t:r') == "index"
return folder . '/' . file
else
return airline#extensions#tabline#formatters#default#format(a:bufnr, a:buffers)
endif
/*
* Request: Javascript
*
* I would like to learn some basic concepts in JavaScript. Just as example, making a stopWatch and creating a racing game with few players which will have start and stop time for each player and choose one winner from them using the stopWatch object.
*/
// Design and Code a StopWatch
// Sample Use Case:
// var sw = new StopWatch();
// sw.start().stop().start().log();
@charset "UTF-8";@font-face{font-family:Ionicons;src:url(../lib/ionic/fonts/ionicons.eot?v=2.0.1);src:url(../lib/ionic/fonts/ionicons.eot?v=2.0.1#iefix) format("embedded-opentype"),url(../lib/ionic/fonts/ionicons.ttf?v=2.0.1) format("truetype"),url(../lib/ionic/fonts/ionicons.woff?v=2.0.1) format("woff"),url(../lib/ionic/fonts/ionicons.svg?v=2.0.1#Ionicons) format("svg");font-weight:400;font-style:normal}.ion,.ion-alert-circled:before,.ion-alert:before,.ion-android-add-circle:before,.ion-android-add:before,.ion-android-alarm-clock:before,.ion-android-alert:before,.ion-android-apps:before,.ion-android-archive:before,.ion-android-arrow-back:before,.ion-android-arrow-down:before,.ion-android-arrow-dropdown-circle:before,.ion-android-arrow-dropdown:before,.ion-android-arrow-dropleft-circle:before,.ion-android-arrow-dropleft:before,.ion-android-arrow-dropright-circle:before,.ion-android-arrow-dropright:before,.ion-android-arrow-dropup-circle:before,.ion-android-arrow-dropup:before,.ion-android-arrow-forward:before
$Theme-font-sizes: (
mobile: (
subvisual: (
small: (
font-size: 16px,
line-height: 28px
),
base: (
font-size: 24px,
@gabrielpoca
gabrielpoca / gist:ac1b31e128e66668c264
Created April 3, 2015 11:31
Mobile web reset styles
*, *:before, *:after {
box-sizing: border-box;
vertical-align: top;
padding: 0;
margin: 0;
-webkit-font-smoothing: antialiased;
// suppressing the tap from users highlight
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
@gabrielpoca
gabrielpoca / Layout
Last active August 29, 2015 14:17
Meteor Packing like a Pro
<template name="Layout">
<div class="Layout">
<div class="Layout-sidebar">{{> Sidebar}}</div>
<div class="Layout-content">{{> Template.contentBlock}}</div>
</div>
</template>
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": false,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": false,
@gabrielpoca
gabrielpoca / html-style
Created March 11, 2015 16:51
HTML Style
<!-- OPTION 1 -->
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-expanded="false">
Admin <span class="caret"></span>
</a>
<!-- OPTION 2 -->
#!/bin/sh
current=`git branch | sed -n '\/* /s///p'`
destiny=${1:-master}
# 1. Update destiny
git fetch
git checkout $destiny
[[ $? == 0 ]] || exit "failed to switch to $destiny"
git rebase