Skip to content

Instantly share code, notes, and snippets.

@searls
searls / .solargraph.yml
Last active September 5, 2024 17:57 — forked from DRBragg/.solargraph.yml
My config with steps to use solargraph for Rails projects in VS Code (WIP)
---
include:
- ".solargraph_definitions.rb"
- "app/**/*.rb"
- "config/**/*.rb"
- "lib/**/*.rb"
exclude:
- test/**/*
- vendor/**/*
- ".bundle/**/*"
@EllyLoel
EllyLoel / reset.css
Last active October 24, 2024 06:51
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@ondrej
ondrej / example.js
Created June 29, 2018 17:16
Example for protocol.interceptStreamProtocol()
const r = require('request');
const zlib = require('zlib');
const text = require('text-encoding');
const stream = require('stream');
var interceptCallback = async (request: any, callback: any) => {
console.log(`intercepted ${request.method} ${request.url}`);
// TODO: support multiple upload data's
var options = {
@mrmartineau
mrmartineau / stimulus.md
Last active September 24, 2024 21:07
Stimulus cheatsheet
@paulirish
paulirish / what-forces-layout.md
Last active November 3, 2024 22:00
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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@apangeajwrubel
apangeajwrubel / gist:4953849
Created February 14, 2013 16:11
our unicorn config
rails_env = ENV['RAILS_ENV'] || 'production'
preload_app true
# number of workers - makes sure this matches memory config
worker_processes Integer(ENV['UNICORN_WORKERS'] || 2)
# restart workers if request takes too long
timeout Integer(ENV['UNICORN_TIMEOUT'] || 25)
# Only allow reasonable backlog of requests per worker
#!/usr/bin/env bash
#
# Wraps curl with a custom-drawn progress bar. Use it just like curl:
#
# $ curl-progress -O http://example.com/file.tar.gz
# $ curl-progress http://example.com/file.tar.gz > file.tar.gz
#
# All arguments to the program are passed directly to curl. Define your
# custom progress bar in the `print_progress` function.
#
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@gmcintire
gmcintire / Basic Oi (Cucumber) Kimchi
Created September 24, 2011 19:16 — forked from jamis/Basic Oi (Cucumber) Kimchi
Basic Oi (Cucumber) Kimchi
BASIC OI (CUCUMBER) KIMCHI
--------------------------------------------------------------------------
Oi (cucumber) kimchi is a delicious, refreshing variation on the
traditional Korean kimchi recipe.
This particular recipe is a modified version of the recipe posted by Dr.
Ben Kim, at http://www.drbenkim.com/how-to-make-cucumber-kim-chi.htm.
--------------------------------------------------------------------------
@TooTallNate
TooTallNate / objc.js
Created July 13, 2011 05:07
Experimentations with node-ffi
var ffi = require('node-ffi')
, objc = new ffi.Library(null, {
'objc_getClass': [ 'pointer', [ 'string' ] ]
, 'class_getName': [ 'string', [ 'pointer' ] ]
, 'sel_registerName': [ 'pointer', [ 'string' ] ]
, 'sel_getName': [ 'string', [ 'pointer' ] ]
, 'objc_msgSend': [ 'pointer', [ 'pointer', 'pointer' ] ]
})
// The problem with libffi and C functions that accepts varargs is that we
// have to create new wrappers for each different argument and return value