Skip to content

Instantly share code, notes, and snippets.

View diegorv's full-sized avatar

Diego Rossini diegorv

View GitHub Profile

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

import React from 'react';
import { View, StyleSheet, ActivityIndicator } from 'react-native';
import { FlatList } from '../searchBarAnimation';
import { List, ListItem } from 'react-native-elements';
export default class Tab extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
@diegorv
diegorv / remove-twitter-likes.js
Created August 31, 2018 01:31 — forked from cacheflowe/remove-twitter-likes.js
Remove your Twitter likes
// go to your account Likes page and run this in the console:
function scrollToLoadMore() {
// keep scrolling if twitter tries to stop loading more.
// scroll up, then down to force infinite load.
window.scrollTo(0, 0);
setTimeout(function() {
window.scrollBy(0, 9999999999);
}, 200);
}
@diegorv
diegorv / rfid_decimal.pde
Created September 6, 2012 13:06 — forked from maniacbug/rfid_decimal.pde
Complete example for reading the 125Khz RFID module RDM630
#include <SoftwareSerial.h>
// Pin definitions
const int rfid_irq = 0;
const int rfid_tx_pin = 6;
const int rfid_rx_pin = 7;
// For communication with RFID module
SoftwareSerial rfid(rfid_tx_pin, rfid_rx_pin);
@diegorv
diegorv / have_named_scope.rb
Created August 24, 2011 19:37 — forked from bcardarella/have_named_scope.rb
Should Have Named Scope matcher for Rspec
module Shoulda # :nodoc:
module ActiveRecord # :nodoc:
# Examples:
# class Book < ActiveRecord::Base
# named_scope :test, :conditions => { :name => "test" }
# named_scope :by_name, lambda { |n| { :conditions => { :name => n} } }
# end
#
# RSpec:
@diegorv
diegorv / allow.rb
Created July 14, 2011 02:09 — forked from fnando/allow.rb
RSpec matcher
RSpec::Matchers.define :allow do |*values|
match do |record|
values.collect {|value|
record.send("#{@attribute}=", value)
record.valid?
record.errors[@attribute].empty?
}.all?
end
chain :as do |attribute|
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'shoulda'
require 'webrat'
require 'factory_girl'
require 'test/factories/clearance'
require 'clearance/../../shoulda_macros/clearance'
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
def wait_for_ajax(timeout=5000)
js_condition = "selenium.browserbot.getCurrentWindow().jQuery.active == 0"
selenium.wait_for_condition(js_condition, timeout)
end
# Set up git repository
git :init
# remove all useless public files
run "rmdir tmp/{pids,sessions,sockets,cache}"
run "rm README"
run "rm log/*.log"
run "rm public/index.html"
run "rm public/javascripts/*"
run "rm public/favicon.ico"