Skip to content

Instantly share code, notes, and snippets.

@jessfraz
jessfraz / boxstarter.ps1
Last active June 23, 2025 13:25
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@asukakenji
asukakenji / 0-go-os-arch.md
Last active August 5, 2025 19:35
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@lattner
lattner / TaskConcurrencyManifesto.md
Last active July 31, 2025 13:12
Swift Concurrency Manifesto
@kluzny
kluzny / similarity_search.rb
Last active February 12, 2021 17:14
simple class that takes an active record model and generates pg's similarity based searches
# frozen_string_literal: true
# Uses pg's trigram extension to enable multi column searches
#
# add a search method to your model
# def self.search(query)
# SimilaritySearch.new(self, over: [:name, :email, :nickname]).search(query)
# end
#
# Then call it with Foo.search("bar")
@maxivak
maxivak / 00.md
Last active August 3, 2025 17:45
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@paulirish
paulirish / what-forces-layout.md
Last active August 11, 2025 02:26
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
@weapp
weapp / benchmark.rb
Created August 7, 2015 08:58
Faraday backends
require 'benchmark/ips'
require 'faraday'
require 'excon'
require 'typhoeus'#, '~> 0.3.3'
require 'patron'
require 'net-http-persistent'
default_adapter = Faraday.new(:url => 'http://localhost') do |faraday|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
end
@PurpleBooth
PurpleBooth / README-Template.md
Last active August 7, 2025 11:30
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@palkan
palkan / gist:d89757a90cfbeb047c63
Last active January 27, 2025 07:25
Rails debug cheat sheet

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@iliabylich
iliabylich / base_doc.rb
Created June 4, 2015 18:40
Apipie concerns
# A common concern,include into all doc modules
#
module BaseDoc
include Apipie::DSL::Concern
def namespace(namespace, options = {})
@namespace = namespace
@namespace_name = options[:name]
end
attr_reader :namespace_name