Skip to content

Instantly share code, notes, and snippets.

@urre
urre / gist:9047935
Last active August 29, 2015 13:56
Modular Pattern with namespacing
var s,
PrimaryNameSpace = {
settings : {
basicExample: $('.main'),
nestedExample : {
first: true,
second: true,
third: true,
fourth: true,
@urre
urre / bem-scss.md
Created May 27, 2014 10:15
BEM and SCSS

BEM

Advantages of using BEM syntax for CSS are:

  1. Design of the website can change at any time, we must be ready for this HTML/CSS code is developing together with the design, ready to its changes
  2. Programmer and front-end developers are working together on the website codebase, contributing to each other's code
  3. Our CSS classes are easier for other team members to understand as they can easily identify the components in the HTML and also the purpose of the CSS classes.
  4. As classes are prefixed with the block it reduces the likelihood of accidentally having two classes with the same name, useful for larger projects.
  5. Using a naming convention gives your CSS and HTML more consistency making it easier to share code between projects.
@urre
urre / supertumblr.html
Created June 2, 2014 15:03
Tumblr theme for getsuperprints.tumblr.com
<!DOCTYPE html>
<html lang="{block:English}en{/block:English}{block:French}fr{/block:French}{block:German}de{/block:German}{block:Japanese}ja{/block:Japanese}{block:Italian}it{/block:Italian}{block:Spanish}es{/block:Spanish}{block:Polish}pl{/block:Polish}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="nofollow" />
<meta name="robots" content="noindex" />
@urre
urre / Comment regex
Created July 23, 2014 08:48
Regex for finding comments in source code
# Regex for finding comments in source code
(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|(//.*)
/**
* Finds this
*/
// And this
@urre
urre / devtabs.sh
Last active August 29, 2015 14:06
Simple example dev setup which opens separate tabs in iTerm for different tasks/runners/servers
#!/bin/bash
# **************************************************************************************
#
# Devtabs
#
# Simple example dev setup which opens separate tabs in iTerm for different tasks/runners/servers
# @urre 140715
#
# **************************************************************************************
@urre
urre / keybase.md
Last active August 29, 2015 14:12
keybase.md

Keybase proof

I hereby claim:

  • I am urre on github.
  • I am urre (https://keybase.io/urre) on keybase.
  • I have a public key whose fingerprint is 763F 83B9 51FA 118E DE95 9888 0B47 509B 6056 2DE2

To claim this, I am signing this object:

@urre
urre / gist:27bf9b1e16fa32195cc0
Created January 14, 2015 15:21
Simple web scraper in Node
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var superagent = require('superagent');
var jazzgreats = [];
var url = 'https://codex.wordpress.org/WordPress_Versions';
request(url, function(error, response, html) {
if(!error){
@urre
urre / gist:a4abe28760cebb8f482d
Created January 24, 2015 13:24
Sublime keybindings
[
// Use Cmd + E for commenting multiple rows/blocks of code
{ "keys": ["super+e"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["super+shift+e"], "command": "toggle_comment", "args": { "block": true } },
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+alt+r"], "command": "reindent"},
]
@urre
urre / gist:c0f6530f2b39b60d44b3
Created January 24, 2015 13:28
Sublime settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"default_dir": "/Applications/MAMP/htdocs/",
"draw_indent_guides": true,
"find_selected_text": true,
"folder_exclude_patterns":
[
@urre
urre / gist:b74770ff63ba4bbce33e
Created February 19, 2015 13:12
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
dir = Dir.pwd
vagrant_dir = File.expand_path(File.dirname(__FILE__))
Vagrant.configure("2") do |config|
# Store the current version of Vagrant for use in conditionals when dealing
# with possible backward compatible issues.