Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando Guillen fguillen

View GitHub Profile
View Trello_highlight_lists_on_IT_Board.js
// ==UserScript==
// @name Trello highlight lists on IT Board
// @description Highlight certain columns in Trello.
// @include https://trello.com/b/CdaXFAGQ/it-work-in-progress
// @require https://code.jquery.com/jquery-3.4.1.min.js
// @version 0.1
// @copyright 2014, Gareth J M Saunders
// @copyright 2019, Dalia Research GmbH
// ==/UserScript==
View Trello_highlight_lists_on_IT_Board.js
// ==UserScript==
// @name Trello highlight lists on IT Board
// @description Highlight certain columns in Trello.
// @include https://trello.com/b/CdaXFAGQ/it-work-in-progress
// @require https://code.jquery.com/jquery-3.4.1.min.js
// @version 0.1
// @copyright 2014, Gareth J M Saunders
// @copyright 2019, Dalia Research GmbH
// ==/UserScript==
@fguillen
fguillen / my_wrapper_creator.rb
Last active May 19, 2019
Providing an `around_action` like functionality in arbitrary Ruby classes
View my_wrapper_creator.rb
module MyWrapperCreator
def my_method_wrapper(method_name)
original_method = instance_method(method_name)
define_method(method_name) do |*args, &block|
puts "wrapper :: INI"
result = original_method.bind(self).call(*args, &block)
puts "wrapper :: END"
result
View clone_table.sql
drop procedure if exists clone_table;
delimiter $$
create procedure clone_table ()
begin
declare n int;
set n := 0;
while n < 20 do
insert destiny_table select
field_1,
View watch_to_file.sh
watch -t -n 30 "(date '+%Y-%m-%d %H:%M:%S,' | tr -d '\n'; curl -o /dev/null -s -w %{time_total} http://myweb.com; echo) | tee -a /tmp/my_web.log"
@fguillen
fguillen / beer_time.rb
Last active Jan 19, 2018
Announce the beer time
View beer_time.rb
# Simple but necessary script (for Mac) to announce when the beer time is comming
# You can configure your crontab like this
# 0 17 * * 5 ruby $HOME/scripts/beer_time.rb >> /var/log/beer_time.log 2>&1
beer_hour = ARGV[0] || 18
def say(message)
`afplay /System/Library/Sounds/Hero.aiff`
`afplay /System/Library/Sounds/Hero.aiff`
`say "#{message}"`
@fguillen
fguillen / rails_log_query_select_scraper.rb
Created Sep 8, 2016
Script to extract, from a Rails log, all the SELECT queries and the duration of each one in a csv format
View rails_log_query_select_scraper.rb
require "csv"
module Script
def self.run(input_path, output_path)
log = File.read(input_path)
lines_count = log.lines.count
index = 0
File.open(output_path, "w") do |output_file|
@fguillen
fguillen / components.translate-component.js
Last active Jun 14, 2016
Helper with ComputeProperty - Component version
View components.translate-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@fguillen
fguillen / controllers.application.js
Last active Jun 14, 2016 — forked from igorstajic/controllers.application.js
Ember Helper and ComputerProperty
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
robotName: '',
robots: Ember.ArrayProxy.create({ content: Ember.A([
{ name: "Mazinger Z" },
{ name: "Lady Electric" }
])}),
actions: {
View application.controller.js
import Ember from 'ember';
function trackPropertyChanges(defaultValue) {
var value = defaultValue;
function updateChangedProperty(model, name, property, value) {
var changedProperties = model.get('changedProperties');
if (!changedProperties) {
changedProperties = Ember.Object.create();
model.set('changedProperties', changedProperties);
You can’t perform that action at this time.