Skip to content

Instantly share code, notes, and snippets.

View siakaramalegos's full-sized avatar
🦄

Sia siakaramalegos

🦄
View GitHub Profile
@yosuke-furukawa
yosuke-furukawa / nodefest_timetable.md
Last active October 18, 2017 02:15
NodeFest Timetable

Timetable

当日のタイムテーブル

11/24

Speakers's dinner 🔈

when where who what
19:30 Shibuya? Staff + Speaker + Sponsers Dinner
@eriktrautman
eriktrautman / sublime_text_2_preferences
Last active January 12, 2018 03:31
Sublime Text 2 User Preferences
// These settings can be found under Sublime Text 2 >> Preferences >> Settings - User
// You can just copy-paste this file right over whatever was there if you want
//
// Check out the file at Sublime Text 2 >> Preferences >> Settings - Default
// to see what options are available for you
{
"color_scheme": "Packages/Color Scheme - Default/LAZY.tmTheme",
"font_size": 14.0,
"ignored_packages":
@BideoWego
BideoWego / Searchable.rb
Last active July 9, 2018 07:13
Model Searchable concern for Rails
module Searchable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
@@searchable_fields = []
@@searchable_scope = nil
def search(q, method=nil)
const frames = [
{
width: 89,
height: 64,
bpp: 1,
transparent: 0,
buffer: E.toArrayBuffer(
atob(
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAwAAAAAAAAAAAAgAEAAAAAAAAAAAMAABAAAAAAAAAABAAABAAAAAAAAAAMB/+AgAAAAAAAAAgf//ggAAAAAAAACD///wgAAAAAAAAIf///wgAAAAAAAAh4///xAAAAAAAACHg/w/BAAAAAAAAIfB+AcCAAAAAAAAB+B4AYCAAAAAAABH8HwAQEAAAAAAAAP4HDwwAAAAAAAAI/weLRyIAAAAAAAR/w4fh+IAAAAAABH//w/j8QAAAAAACP//j/H8AAAAAAAEf//H+P4gAAAAAAB//+P8PwAAAAAAAD//8f4fwAAAAAABH//4/w/iAAAAAACP//w/j/EAAAAAAI///h/H+AAAAAAAR///j+P8AAAAAAAH///H8f4AAAAAACP//+Hw/wAAAAAAAf//8Lj/gAAAAAAR///8KH/EAAAAAAD///4cf+IAAAAACH///4Q/8AAAAAAAP///4D/xAAAAAAQP///wH/iAAAAABAf///wf/AAAAAAAI////w/8AAAAAAIw////j/4gAAAAAjx////n/wAAAAACHh//////EAAAAAIfh/////+IAAAAAh/h/////8AAAAACH/h/////xAAAAAMf/h/////iAAAAAR//g/////AAAAABH//gP///8QAAAAEP//wB///4gAAAAQ///4D///xAAAABD///+H///iAAAAEP////////EAAAAQ////////+IAAABD////////+QAAAEP////////8AAAAQ/////////4gAAAj/////////xAAACP/////////iAAAEf/////////gAA
@rviscomi
rviscomi / CrashCourseInCrUX.md
Last active May 7, 2019 10:52
"Crash Course in CrUX" for the PerfMatters conference, April 2019
@mperham
mperham / after.rb
Created July 4, 2012 19:30
Thread-friendly shared connection
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection }
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@jacob-beltran
jacob-beltran / requestAnimationFrame.js
Last active April 17, 2020 04:05
React Performance: requestAnimationFrame Example
// How to ensure that our animation loop ends on component unount
componentDidMount() {
this.startLoop();
}
componentWillUnmount() {
this.stopLoop();
}
@SabretWoW
SabretWoW / json_response_handling_ruby.rb
Created December 11, 2013 14:20
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
@jwo
jwo / secret_controller.rb
Created November 5, 2013 17:57
Devise testing controllers - minitest / rails4
class SecretController < ApplicationController
before_filter :authenticate_user!
def show
end
end
@Aidurber
Aidurber / cleanup.sh
Last active September 29, 2022 13:14
A handy script to clean up a mac thanks to - Gant Laborde's article: https://medium.freecodecamp.org/how-to-free-up-space-on-your-developer-mac-f542f66ddfb
# Cleanup old node_modules
echo "Cleaning node_modules in projects older than 30 days"
find . -name "node_modules" -type d -mtime +30 | xargs rm -rf
echo "Done cleaning node_modules"
# Clean up homebrew
echo "Clean homebrew"
brew update && brew upgrade && brew cleanup
echo "Done cleaning homebrew"