Skip to content

Instantly share code, notes, and snippets.

View dx7's full-sized avatar

Rafael Carvalho dx7

View GitHub Profile
puts "Hello from Gist"
require 'formula'
class Ffmpeg < Formula
homepage 'http://ffmpeg.org/'
url 'http://ffmpeg.org/releases/ffmpeg-2.0.1.tar.bz2'
sha1 'cc36c696228221ce14585edd90fb6413d206a5c8'
head 'git://git.videolan.org/ffmpeg.git'
option "without-x264", "Disable H.264 encoder"
@dx7
dx7 / gist:5623348
Created May 21, 2013 21:20
Smooth Streaming manifest generated by USP from edited ISM with just one audio track. It works fine.
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Unified Streaming Platform(version=1.4.57)-->
<SmoothStreamingMedia
MajorVersion="2"
MinorVersion="0"
TimeScale="10000000"
Duration="3022933333">
<StreamIndex
Type="audio"
QualityLevels="1"
@dx7
dx7 / gist:5623339
Created May 21, 2013 21:19
ISM file edited. It has just one audio track.
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Unified Streaming Platform(version=1.4.57)-->
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<meta name="clientManifestRelativePath" content="10004284.ismc" />
<meta name="creator" content="Unified Streaming Platform (USP)" />
<meta name="lookahead_fragments" content="2" />
<meta name="dvr_window_length" content="30" />
<meta name="archive_segment_length" content="0" />
<meta name="archiving" content="false" />
@dx7
dx7 / gist:5623321
Created May 21, 2013 21:16
Smooth Streaming manifest generated by USP with 4 video files. It doesn't play.
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Unified Streaming Platform(version=1.4.57)-->
<SmoothStreamingMedia
MajorVersion="2"
MinorVersion="0"
TimeScale="10000000"
Duration="3023146666">
<StreamIndex
Type="audio"
QualityLevels="3"
@dx7
dx7 / gist:5623317
Created May 21, 2013 21:15
ISM file generated by USP with 4 video files.
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Unified Streaming Platform(version=1.4.57)-->
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<head>
<meta name="clientManifestRelativePath" content="10004284.ismc" />
<meta name="creator" content="Unified Streaming Platform (USP)" />
<meta name="lookahead_fragments" content="2" />
<meta name="dvr_window_length" content="30" />
<meta name="archive_segment_length" content="0" />
<meta name="archiving" content="false" />
activerecord:
models:
contato:
zero: contatos
one: contato
other: contatos
# ...
@dx7
dx7 / gist:5297012
Last active December 15, 2015 17:29
Adiciona -*- coding: utf-8 -*- em todos os arquivos .rb e .rake
Remove comentários antigos
find . -iname "*.rb" -print0 -o -iname "*.rake" -print0 | xargs -0 -I {} sed -i "" -E -e "/^#.*coding.*utf-8.*$/d" {}
Adiciona novo magic encoding comment
find . -iname "*.rb" -print0 -o -iname "*.rake" -print0 | xargs -0 -I {} gsed -i '1i# -*- coding: utf-8 -*-' {}
@dx7
dx7 / gist:5119553
Last active December 14, 2015 16:59
Busca e troca sua senha e token em todo o histórico do repositório git. Útil quando vc faz commit com dados sensíveis e precisa abrir o repositório.
git filter-branch -f --tree-filter "find . -type f -exec sed -e s/your-plain-password/some-string/ -e s/\'your-plain-token\'/ENV[\'ENVIRONMENT_VARIABLE_TOKEN\']/ -i '' {} \;"
@dx7
dx7 / gist:4260217
Created December 11, 2012 16:50
In the Beginning was the Command Line - by Neal Stephenson
In the Beginning was the Command Line
by Neal Stephenson
About twenty years ago Jobs and Wozniak, the founders of Apple, came up with the very strange idea of selling information processing machines for use in the home. The business took off, and its founders made a lot of money and received the credit they deserved for being daring visionaries. But around the same time, Bill Gates and Paul Allen came up with an idea even stranger and more fantastical: selling computer operating systems. This was much weirder than the idea of Jobs and Wozniak. A computer at least had some sort of physical reality to it. It came in a box, you could open it up and plug it in and watch lights blink. An operating system had no tangible incarnation at all. It arrived on a disk, of course, but the disk was, in effect, nothing more than the box that the OS came in. The product itself was a very long string of ones and zeroes that, when properly installed and coddled, gave you the ability to manipulate other very long strings of o