Skip to content

Instantly share code, notes, and snippets.

View RobinDaugherty's full-sized avatar

Robin Daugherty RobinDaugherty

View GitHub Profile
@ollieatkinson
ollieatkinson / Publishers+RetryDelay.swift
Last active June 10, 2024 11:26
Add a delay in-between each Combine retry, offering a timing function and default implementations for none, constant seconds and exponential backoff
import Combine
import Foundation
extension Publisher {
public func retry<S: Scheduler>(
_ max: Int = Int.max,
delay: Publishers.RetryDelay<Self, S>.TimingFunction,
scheduler: S
) -> Publishers.RetryDelay<Self, S> {
@koenpunt
koenpunt / node-14.16.0.patch
Last active April 29, 2021 01:39
Node 14.16.0 patch to support WASM on ARM64 Macs, based on the changes here: https://github.com/nodejs/node/pull/35986
From 42fdc91e497cc1fc7380b1bfd14216802ed4c63c Mon Sep 17 00:00:00 2001
From: Koen Punt <koen@koenpunt.nl>
Date: Tue, 16 Mar 2021 11:10:48 +0100
Subject: [PATCH] patch
---
common.gypi | 2 +-
deps/v8/BUILD.gn | 1 +
deps/v8/include/v8-platform.h | 8 ++-
deps/v8/src/base/page-allocator.cc | 14 ++++
@SergLam
SergLam / Steps.swift
Last active April 10, 2024 20:14
XCode quick install / update
// Original video tutorial
// https://www.youtube.com/watch?v=6iSuc2vxT8g
// 0. Install a Homebrew
// https://brew.sh/
// 1. Install Ruby to your Mac
// brew install ruby
// 2. Install aria2 tool
@j-fischer
j-fischer / incomingCalls.js
Last active October 28, 2021 02:49
Twilio functions to forward phone calls to multiple cell phones. See https://cloudthingsyyc.wordpress.com/2018/01/15/hpaas-home-phone-as-a-service/ for more details.
const format = require('string-format');
// These are the numbers to forward the call to
const destinations = ['+1', '+1'];
// These are the numbers that will be forwarded to the cell phones
const allowedCallers = [
'+1', //
];
@james-s-tayler
james-s-tayler / install-java-8-on-ubuntu-14.04-auto-accept-licence-agreement.sh
Last active November 13, 2018 08:37
Install oracle Java 8 on Ubuntu 14.04 and automatically accept the licence agreement. 100% hands-free install.
#! /bin/bash
sudo apt-get update
sudo apt-get install -y software-properties-common debconf-utils
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo apt-get install -y oracle-java8-installer
@elado
elado / cequel-database_cleaner.rb
Last active April 8, 2021 08:25
Cequel + DatabaseCleaner and RSpec
# in spec_helper.rb
RSpec.configure do |config|
records = []
config.before :suite do
Cequel::Record.descendants.each do |klass|
klass.after_create {|r| records << r }
end
end
@asavin
asavin / 01 capybara.rb
Last active March 16, 2021 15:37
Gists for the Automated cross-browser testing blogpost
# features/support/capybara.rb
Capybara.app_host = 'http://staging.my-app.com'
@lfender6445
lfender6445 / gist:9919357
Last active June 23, 2024 09:14
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@blacktm
blacktm / install_ruby_rpi.sh
Last active May 26, 2024 15:13
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@dpsk
dpsk / README.md
Last active December 17, 2015 12:38

Commands examples

If the namespace is not used then the commands will perform on top of the default database. bundle exec rake db:create bundle exec rake db:migrate

By using the namespace we are going to use all the configuration for our alternate DB. bundle exec rake store:db:create bundle exec rake store:db:migrate