Skip to content

Instantly share code, notes, and snippets.

View cacheflow's full-sized avatar
🎯
Focusing

Lex cacheflow

🎯
Focusing
View GitHub Profile
@cacheflow
cacheflow / deploy_hooks.yml
Created May 29, 2020 21:50 — forked from armchairlinguist/deploy_hooks.yml
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
production:
after_symlink:
- source: /.cloud66/log_files.yml
destination: /etc/log_files.yml
sudo: true
target: any
apply_during: all
- source: /.cloud66/remote_syslog.init.d
destination: /etc/init.d/remote_syslog

Technical Papers

2019

  1. Oct 15: Google's Bigtable paper
  2. Dec 5: "Producing Wrong Data Without Doing Anything Obviously Wrong!" +

2020

  1. Jan 20: "Source Code Rejuvenation is not Refactoring" +
import isNil from "@unction/isnil";
export default function get(name: any) {
return function getProperty(keyedFunctor: any): null | unknown {
if (isNil(keyedFunctor)) {
return keyedFunctor;
}
if (keyedFunctor.get) {
return keyedFunctor.get(name);
[
[
[a, b],
[c, d]
],
[
[a, d]
]
@cacheflow
cacheflow / what-forces-layout.md
Created June 26, 2019 06:30 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
const { Scheduler } = require('@ssense/sscheduler');
let scheduler = new Scheduler();
let availability = scheduler.getAvailability({
from: '2017-02-01',
to: '2017-02-02',
duration: 30,
interval: 30,
schedule: {
weekdays: {
class Differ
attr_reader :data1, :data2
def initialize(data1, data2)
if data1 === nil || data2 === nil
raise ArgumentError.new("Can't diff nil values")
end
@data1 = data1
@data2 = data2
check_matching_parameters
@cacheflow
cacheflow / gist:4b81d16873261fd56dfc68cf21cabba7
Created June 12, 2019 17:08 — forked from ryanlecompte/gist:1283413
Providing an ActiveRecord-like before_filter capability to arbitrary Ruby classes
# First the end result of what we want:
class Foo
before_hook :whoa
before_hook :amazing
def test
puts "This is kinda cool!"
end
i = 0
j = 24 * 30
first_hour = 4
end_hour = 5
h = {}
while(i < j) do
start_time = Time.current.beginning_of_hour + first_hour.hours
end_time = Time.current.beginning_of_hour + end_hour.hours
first_hour +=1
end_hour +=1