Skip to content

Instantly share code, notes, and snippets.

@fguillen
fguillen / config.log
Created January 21, 2012 18:53
brew install ffmpeg ERROR
# ./configure --prefix=/usr/local/Cellar/ffmpeg/0.9.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bin/clang --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --disable-ffplay
ACODEC_TESTS='ac3_fixed_test
adpcm_ima_qt_test
adpcm_ima_wav_test
adpcm_ms_test
adpcm_swf_test
adpcm_yam_test
alac_test
aref_test
flac_test
@fguillen
fguillen / EvasiveMouse.md
Created February 27, 2012 17:15
Coding Puzzle example

EvasiveMouse

An smart mouse always obtains the cheese without being detected.

Description

You are an office mouse, and you're very lucky because in every office of the building where you live there is always one piece of cheese.

You have worked hard to make one mousehole in every office.

@fguillen
fguillen / middle_point_coordinates.js
Created March 3, 2012 12:22
Calculation of the coordinates or a point in the middle of two points
function distancePoints( xA, yA, xB, yB ){
var xDistance = Math.abs( xA - xB );
var yDistance = Math.abs( yA - yB );
return Math.sqrt( Math.pow( xDistance, 2 ) + Math.pow( yDistance, 2 ) );
}
function coordinatesMediumPoint( xA, yA, xB, yB, distanceAC ){
var distanceAB = distancePoints( xA, yA, xB, yB );
var angleAB = Math.atan2( ( yB - yA ), ( xB - xA ) );
@fguillen
fguillen / suite-description.yml
Created March 13, 2012 10:18
TESTA suite description
output_path: "~/testa-logs"
tests:
interstitial:
name: "interstitial"
commands: |
navigate.to "http://interstitial.com"
command1
command2
@fguillen
fguillen / testa-README.md
Created March 13, 2012 10:57
explanation of new TESTA functionalities

I have been reading the shared documentation:

It is a good work what you have done here but it looks like a little confuse due the 90% of the doc is talking about technical stuff.

This technical information is gonna be helpful for the development but in a "specification" time we should focus in "what we need" and not in "how to implement it"..

Also Juan has pointed me that we can not use the name BrowserShooter because is misunderstanding its possibilities. BrowserShooter is not a VM screenshot system but a Multi-Browser test system, with a lot of configuration possibilites we are still requesting as missing. For now on we can use the key name "TESTA" for this project.. or any other thing you suggest :)

@fguillen
fguillen / ajax_events.js
Created July 26, 2012 15:44
Declaring console log for every AJAX Event
$(function(){
console.log( "Loading AJAX Event logger ..." );
$(document).ajaxSend( function( event, jqXHR, ajaxOptions ){
console.log( "ajaxSend" );
console.log( "ajaxSend.event", event );
console.log( "ajaxSend.jqXHR", jqXHR );
console.log( "ajaxSend.ajaxOptions", ajaxOptions );
});
@fguillen
fguillen / AutoUpdatedCollection.js
Created August 7, 2012 18:58
Backbone AutoUpdatedCollection
/*
In the scenario you have a _shared Collection_ which contains every Model of one class,
and this Collection is used to populate _sub-Collections_ those have to be _updated_
when the shared Collection is updated.
*/
App.AutoUpdatedCollection = Backbone.Model.extend({
initialize: function( opts ){
this.name = opts.name;
this.sourceCollection = opts.sourceCollection;
@fguillen
fguillen / array_shuffle_into.rb
Created February 6, 2013 11:06
Ruby, how to shuffle one array into another
# Inspired in the answers: http://stackoverflow.com/questions/4908413/how-to-initialize-an-array-in-one-step-using-ruby
class Array
def shuffle_into(array)
a1 = self.dup
a2 = array.dup
(a1.size + a2.size).times.map do
[true, false].sample ? (a1.shift || a2.shift) : (a2.shift || a1.shift)
end
@fguillen
fguillen / .gitignore
Last active December 12, 2015 06:49
Code example to reproduce the issue "ActiveRecord, find by polymorphic attribute" http://stackoverflow.com/q/14753611/316700
.rvmrc
polymorphic.sqlite
<html>
<video width="340" controls="controls" id="video">
<source src="http://archive.org/download/Pepa-creativeCommonsMp4956/Pepa-creativeCommonsMp4956.mp4" type="video/mp4" />
<track kind="subtitles" src="https://gist.github.com/fguillen/4742221/raw/83d2e2d1f2e0bdc96a733a15b608941216ab9fca/subs.+vtt"/>
</video>
</html>