Skip to content

Instantly share code, notes, and snippets.

View demoive's full-sized avatar

Paulo Ávila demoive

  • Barcelona
View GitHub Profile
@demoive
demoive / .htaccess
Created May 8, 2013 05:35
SSi18n configuration files Used for the seed: For the https://github.com/demoive/SSi18n
### General settings
#####################################
DirectoryIndex index.inc
Options +FollowSymlinks
Options -Indexes
### Enable GZIP compression
#####################################
@demoive
demoive / vendorify.less
Last active December 17, 2015 16:49
A LESS mixin to generate vendor-specific (browser-specific/experimental) CSS properties.
.vendorify(@prop, @vals...) {
@property: e('@{prop}');
@values: `'@{arguments}'.replace(/^\[|\]$/g, '').split(', ').splice(1)`;
// v1.6.0 added interpolation allowing us to do this:
-o-@{property}: @values;
-ms-@{property}: @values;
-moz-@{property}: @values;
-webkit-@{property}: @values;
@{property}: @values;
@demoive
demoive / .vimrc
Last active December 18, 2015 07:19
My configuration file for Vim
syntax on " turns syntax highlighting on
colorscheme default " defines the color scheme of the syntax highlighting
set nocompatible " (cp) use Vim defaults (much better)
set hidden " (hid) hide buffers instead of closing them when they are abandoned
set ruler " (ru) show the cursor position at all times
set showcmd " (sc) display an incomplete command in the lower right
set history=100 " (hi) keep 50 lines of command history
set undolevels=100 " (ul) maximum number of changes that can be undone
set number " (nu) show line numbers
function PrimeNumberGenerator() {
this.indx = 2;
}
PrimeNumberGenerator.prototype.next = function () {
var counter = 2;
while (counter < this.indx) {
if (this.indx % counter++ === 0) {
counter = 2;
@demoive
demoive / 1-questions.md
Last active December 20, 2015 06:58
Front-end Developer Questions Customized list of questions/answers for front-end developer interviews. It is an offshoot of the great, user-contributed list located here: https://github.com/darcyclarke/Front-end-Developer-Interview-Questions/
  1. What is the "smallest" number possible in JavaScript?

  2. Explain why the following doesn't work as an IIFE. What needs to be changed to properly make it an IIFE? function foo(){ }();

  3. What is arr.length?

var arr = [];
arr[10] = 'ten';
@demoive
demoive / .bash_logout
Last active December 15, 2015 02:21
My Bash Stuff
# .bash_logout
# Executed after logout of bash shells
clear
@demoive
demoive / bash_colors.sh
Last active August 29, 2015 14:01
Displays all the bash colors to the screen
### Bash colors and formatting
# To set the formatting/color, use the following:
# - escape character (\e, \033, \x1B)
# - open square bracket
# - attributes (semicolon-separated)
# - the letter m
#
# \033[<attribute>;...m
@demoive
demoive / .hgrc
Last active December 3, 2015 00:06
My config settings for Mercurial
[ui]
username = Paulo Avila #<>
status.modified = blue bold # M
status.added = green bold # A
status.removed = red bold # R
#status.clean = # C
#status.deleted = cyan bold #
#status.missing = # !
#status.untracked = blue bold # ?
@demoive
demoive / .hg_template
Last active December 2, 2015 01:38
Template file for Mercurial smartlog
changeset = "{shortest(node)} {label('blue', '{author|user}')}{if(phabdiff, label('bold', \" {phabdiff}\"))}{bookmarks} {label('cyan', '({date|age})')}\n{desc|firstline}{ifeq(rev, revset('.'), '{files}{file_mods}{file_adds}{file_dels}')}\n\n"
# CURRENTLY, for some reason, the ifeq() condition doesn't work
# I think it's because we're doing the check with "current" inside this "bookmark variable"
bookmark = " {ifeq(bookmark, current, label('yellow', '{bookmark}*'), label('green', '{bookmark}'))}"
#start_files = "ALL:\n"
start_files = "\n\n {sub(\"(\d+):\s+\+(\d+)\/-(\d+)\", label('magenta underline', '\\1 files changed: +\\2/-\\3:'), diffstat)}"
file = ""
end_files = ""
@demoive
demoive / .gitconfig
Last active April 25, 2017 20:11
My config settings for Git
[user]
name = Paulo Avila
#email =
[alias]
br = branch
co = checkout
ci = commit -a
feature = checkout -b
amend = commit --amend #--no-edit