Skip to content

Instantly share code, notes, and snippets.

View kaiquewdev's full-sized avatar

Kaique Silva kaiquewdev

View GitHub Profile
// When using angular-translate it's impossible to make two-way data binding translations yet,
// and this sometimes can be a headache. So I've developed this directive to save some time.
// The view goes like this: <TAG data-bind-translate="scopeObjToTranslate.item.text"></TAG>.
angular.module('myApp', ['pascalprecht.translate']).directive('bindTranslate', [
'$translate',
'$parse',
function($translate, $parse) {
@netojoaobatista
netojoaobatista / dica.md
Last active February 25, 2019 14:08
Dica para não programadores aprenderem a pensar em programação

Por estar envolvido diretamente com várias comunidades de desenvolvedores, de diversas linguagens, vejo, com frequência, uma série de dificuldades de entendimento por parte dos mais novos (leia-se iniciantes em programação). Essa dificuldade de entendimento, normalmente, está relacionada com uma confusão em relação ao objetivo real do desenvolvimento de software.

Programar, ao contrário do que os mais novos pensam, não se trata de escrever códigos. De fato, trata-se de percepção com o objetivo puro e simples de se resolver problemas. O código é apenas uma, entre as várias atribuições do programador e, acreditem, não é a mais importante.

Digo que não é a mais importante, pois o código é apenas a aplicação de uma linguagem. Porém, quando se percebe que uma linguagem é apenas uma ferramenta, dentre várias ferramentas que podem ser utilizadas, compreende-se que o código naquela linguagem é equivalente ao serrote utilizado pelo marceneiro.

Alguém aqui definiria um marceneiro como um cara que sabe usar um serrot

Why declaring globals is better than exporting

The module pattern

During the past several years the way of managing JavaScript dependencies evolved bringing some advanced solutions. One of the concepts which became very popular today, is a module pattern. The beginning of [this

@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@LeaVerou
LeaVerou / dabblet.css
Created June 19, 2013 17:40
Playing with background-attachment
/**
* Playing with background-attachment
*/
pre {
max-height: 150px;
border: 1px solid silver;
overflow: auto;
border: 10px dotted red;
background: url('http://placedog.com/200/200');
@franklinjavier
franklinjavier / install-sublime-ubuntu.sh
Created April 9, 2013 04:20
Install Sublime Text 2 on Ubuntu
#!/bin/bash
# Script to install Sublime Text on Ubuntu
# Apr 9 2013 - @franklinjavier
echo "Downloading Sublime Text 2"
wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.1\ x64.tar.bz2
echo "Unziping and moving"
tar -xvf Sublime\ Text\ 2.0.1\ x64.tar.bz2
mv Sublime\ Text\ 2 sublimeText
@franklinjavier
franklinjavier / sync.sh
Created March 21, 2013 00:25
Set-up Sublime settings + packages sync over Dropbox
#!/bin/sh
#
# Set-up Sublime settings + packages sync over Dropbox
#
# Will sync settings + Installed plug-ins
#
# Tested on OSX - should support Linux too as long as
# you set-up correct SOURCE folder
#
# Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Operating System
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
@tj
tj / bash
Created November 2, 2012 03:51
Install anything from Github with a `make install` target
#!/usr/bin/env bash
repo=$1
rm -fr /tmp/gpm \
&& mkdir /tmp/gpm \
&& cd /tmp/gpm \
&& curl -#L https://github.com/$repo/tarball/master \
| tar zx --strip 1 \
&& make install