Skip to content

Instantly share code, notes, and snippets.

Avatar

Sérgio Lopes sergiolopes

View GitHub Profile
View rotate.html
<canvas width=300 height=300 style="display:none"></canvas>
<h4>Original</h4>
<img class="original" src="https://dl.dropboxusercontent.com/u/139992952/stackoverflow/house-icon.png">
<h4>90 graus</h4>
<img class="rotate90">
<h4>180 graus</h4>
<img class="rotate180">
View config.json
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
View TODO.md

Cursos online de música. Aprenda teclado e piano online. Aulas online com professores experientes, exercícios práticos, playbacks exclusivos de músicas, partituras, cifras e tira dúvidas com professor.

Assinatura mensal ilimitada dá acesso a todo conteúdo. No futuro, até violão e guitarra.

Cursos online de teclado e piano MusicDot.

View Anuncio.md

Quer aprender a tocar violão?

Não é a toa que o violão é instrumento popular. Fácil de tocar em todos os lugares, divertido para acompanhar uma roda de amigos, e não exige um grande investimento. Para tocar, basta vontade, dedicação e um bom professor.

Acabamos de colocar no ar o curso Primeiros passos com Violão disponível já para todos assinantes. Aprenda as principais posições e batidas para sair tocando diversas músicas! Aprenda também como nomear acordes, numerar casas e cordas, a diferença entre acordes maiores e menores, seu primeiro dedilhado e muito mais!

O novo curso faz parte da assinatura ilimitada da MusicDot. Com uma mensalidade de só R$ 49 você acessa todos os cursos, exercícios práticos, playbacks de músicas, cifras, partituras e tira dúvidas com professor. Se ainda não é aluno, assine agora!

Cursos online de violão e guitarra

@sergiolopes
sergiolopes / gist:97e25e1baef0e9af68f6
Last active August 29, 2015 14:06
PPK's mobile web book - Viewport
View gist:97e25e1baef0e9af68f6

My technical notes/suggestions about the Viewport chapter on ppk's amazing mobile web book:

  1. About Media Queries, in the Syntatic Notes section there is: "all media queries require a media type". It's true, a media type is always applied, but the spec allows you to omit it if it's all and. In http://www.w3.org/TR/css3-mediaqueries/#media0 right above the Example 5, it says: "A shorthand syntax is offered for media queries that apply to all media types; the keyword ‘all’ can be left out (along with the trailing ‘and’). I.e. if the media type is not explicitly given it is ‘all’." So we can just use @media (min-width: 200px){} and I think that's the syntax that should be preferred.

  2. About ems in media queries. It misses the main point why em media queries became famous in the first place: page zoom on Desktop WebKit browsers didn't work with px media queries. That is, WebKit had a bug and didn't recalculate the media queries when page zoom was applied (it was like the 'px' in media quer

@sergiolopes
sergiolopes / export-slides.js
Created September 16, 2014 17:31
Export a lot of PNG files from your cool HTML5 presentation.
View export-slides.js
/**
Export a lot of PNG files from your cool HTML5 presentation.
(requires PhantomJS)
Created by Sérgio Lopes - http://sergiolopes.org/
*/
(function(){
@sergiolopes
sergiolopes / script.sh
Created October 7, 2014 21:49
Copy EXIF date from videos to file modification time
View script.sh
for i in */*.MP4; do
echo "$i "
date=$(exiftool "$i"|grep "Create Date" | head -n 1|cut -b35-|sed -e 's/\:[0-9][0-9]$//g;s/://g;s/ //g')
touch -t "$date" "$i"
done
for i in */*.MTS; do
echo "$i " ;
date=$(exiftool "$i"|grep Original|cut -b35-|sed -e 's/\:[0-9][0-9]\+.*//g;s/://g;s/ //g');
touch -t "$date" "$i";
@sergiolopes
sergiolopes / SassMeister-input.scss
Created August 5, 2015 14:17
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
h1 {
font-size: 1em;
@media (min-width: 600px) {
font-size: 2em;
}
@sergiolopes
sergiolopes / TubainaAFCLexer.py
Created September 30, 2009 08:05
Tubaixa AFC lexer for Pygments
View TubainaAFCLexer.py
from pygments.lexers.compiled import JavaLexer
from pygments.lexers.web import XmlLexer
from pygments.lexers.agile import RubyLexer
class TubainaAFCLexer(RegexLexer):
"""
A lexer that highlights Tubaina AFC syntax.
"""
name = 'AFC'
@sergiolopes
sergiolopes / Data.scala
Created October 11, 2009 15:19
DSL em Scala para cálculos simples de Data
View Data.scala
import java.util.Calendar
class Data (val data: Calendar) {
import Data.Conjuncao
private var ultimo = 0;
def mais(num: Int) = { ultimo = num; this }
def menos(num: Int) = { ultimo = -num; this}
def meses = { data.add(Calendar.MONTH, ultimo); this }