Skip to content

Instantly share code, notes, and snippets.

@breim
breim / production.rb
Created March 30, 2015 22:49
CultureProduction
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true #true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
<!-- Fixed navbar -->
<nav class="navbar navbar-user navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@breim
breim / application.yml
Last active August 29, 2015 14:18
Env scaffold with figaro
development:
ANONPAD_DATABASE_USER: postgres
ANONPAD_DATABASE_PASSWORD: 123abc@
@breim
breim / gist:13ec2820657590c6cd56
Created April 6, 2015 01:44
Mechanize testing
task :news_user => :environment do
require 'mechanize'
json = Mechanize.new.get('https://graph.facebook.com/500142683407521/members?access_token=331190933592525|jPIKJ-nDyiYq_MqF9hWKqapF6KE').body
#json = Mechanize.new.get('https://graph.facebook.com/100001426926632/friends?access_token=331190933592525|jPIKJ-nDyiYq_MqF9hWKqapF6KE').body
result = JSON.parse json
agent = Mechanize.new
repeat = result['data'].count
repeat.times do |i|
abrir = Mechanize.new.get('https://graph.facebook.com/'+ result['data'][i]['id'] +'/').body
@breim
breim / test
Created April 9, 2015 14:22
ffmpeg
> ./ffmpeg -v 9 -loglevel 99 -re -i test.flv -an -vcodec libx264 -b:v
> 128k -vpre ipod320 -f mpegts -y test.ts
# Decompress SWF
swfcombine -d primeirojzjmcae2.swf -o file_new.swf
# Generate gnash dump
dump-gnash -D video.out@30 -t 30 file_new.swf
# Decompress SWF
swfcombine -d primeirojzjmcae2.swf -o file_new.swf
# Generate gnash dump
dump-gnash -D video.out@30 -t 30 file_new.swf
# Play video
mplayer -demuxer rawvideo \
-rawvideo fps=30:w=1920:h=1080:format=bgra video.out
# Decompress SWF
swfcombine -d primeirojzjmcae2.swf -o file_new.swf
# Generate gnash dump
dump-gnash -D video.out@30 -t 30 file_new.swf
# Play video
mplayer -demuxer rawvideo \
-rawvideo fps=30:w=1920:h=1080:format=bgra video.out
# Decompress SWF
swfcombine -d primeirojzjmcae2.swf -o file_new.swf
# Generate gnash dump
dump-gnash -D video.out@30 -t 30 file_new.swf
# Play video
mplayer -demuxer rawvideo \
-rawvideo fps=30:w=1920:h=1080:format=bgra video.out
# Decompress SWF
swfcombine -d primeirojzjmcae2.swf -o file_new.swf
# Generate gnash dump
dump-gnash -D video.out@30 -t 30 file_new.swf
# Play video
mplayer -demuxer rawvideo \
-rawvideo fps=30:w=1920:h=1080:format=bgra video.out