Skip to content

Instantly share code, notes, and snippets.

View AgtLucas's full-sized avatar
🌎
💀⏳🌷

Lucas AgtLucas

🌎
💀⏳🌷
View GitHub Profile

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@AgtLucas
AgtLucas / gist:7466301
Created November 14, 2013 12:55
Ninja
String.prototype.accents = [
new RegExp('[áàãâ]', 'g'),
new RegExp('[ÁÀÃÂ]', 'g'),
new RegExp('[éèê]', 'g'),
new RegExp('[ÉÈÊ]', 'g'),
new RegExp('[íìïî]', 'g'),
new RegExp('[ÍÌÏÎ]', 'g'),
new RegExp('[óòõô]', 'g'),
new RegExp('[ÓÒÕÔ]', 'g'),
new RegExp('[úùüû]', 'g'),
@AgtLucas
AgtLucas / mike-alpha-golf.sql
Last active December 30, 2015 15:39
Dance of Death...
DROP TABLE CONEXOES;
DROP TABLE CAMINHOS;
DROP TABLE FILA;
DROP TABLE ROTAS;
CREATE TABLE FILA(
ORDEM NUMBER(15),
ELEMENTO VARCHAR(10)
);

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
// .scss
$azul: #6f92ba;
p {
color: $azul;
}
// .sass
$azul: #6f92ba
ul {
list-style: none;
}
ul li {
float: left;
}
ul li a {
color: tomato;
// .scss
ul {
list-style: none;
li {
float: left;
a {
color: tomato;
&:hover {
color: teal;
}
// Podemos usar todas as operações
// .scss
margin: 40px + 10px;
margin: 40px - 10px;
margin: 40px * 10px;
margin: (40px / 10px);
// .sass
margin: 40px + 10px
margin: 40px - 10px
// .scss
width: percentage(2.5); // retorna => width: 250%;
width: round(10.6px); // retorna => width: 10px;
width: ceil(10.6px); // retorna => width: 11px;
width: floor(2.5px); // retorna => width: 2px;
width: abs(-2.5px); // retorna => width: 2.5px;
// .sass
width: percentage(2.5)
// etc...
// .scss
.btn {
width: 140px
padding: 10px;
}
.btn-success {
@extend .btn;
background: green;
}