Skip to content

Instantly share code, notes, and snippets.

@borekb
borekb / README.md
Last active April 2, 2024 19:56
How to link to headings in GitHub issues and pull requests

How to link to headings in GitHub issues and pull requests

If you have an issue comment / PR description on GitHub, it doesn't automatically get anchors / IDs that you could link to:

Screenshot 2019-07-11 at 13

What I like to do is to add a visible # character like this:

Screenshot 2019-07-11 at 13 42 21

@trunet
trunet / graphql-go-mongodb-example.go
Created June 18, 2018 13:28 — forked from aquiseb/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@outofcoffee
outofcoffee / find-ecr-image.sh
Last active March 1, 2024 13:35
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@regilero
regilero / nginx.conf
Last active February 26, 2021 12:22 — forked from thoop/nginx.conf
Altered prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
# Generate $prerender_ua bool value based on user agent
# indexation bots will get this as 1,
# prerender user agent will always get 0 (avoid loops)
map $http_user_agent $prerender_ua {
default 0;
@smanolloff
smanolloff / setenv.sh
Last active July 4, 2018 11:16
MacOS: optimize RVM ruby in Sublime Text 3
#!/bin/sh
rvmdir="$HOME/.rvm"
rubyversion=$(${rvmdir}/bin/rvm-auto-ruby -e 'puts ENV.fetch("RUBY_VERSION")')
export PATH="${rvmdir}/gems/${rubyversion}/bin"\
":${rvmdir}/gems/${rubyversion}@global/bin"\
":${rvmdir}/rubies/${rubyversion}/bin"\
":${rvmdir}/bin"\
":$PATH"
@tylerhunt
tylerhunt / global_id.rb
Created August 7, 2015 18:51
RSpec shared context to allow testing of Active Job objects with GlobalID-compatible doubles.
RSpec.shared_context 'Global ID', :global_id do
def global_id_instance_double(doubled_class, stubs={})
instance_double(doubled_class, stubs)
.extend(GlobalID::Identification)
.tap { |double|
unless double.respond_to?(:id)
allow(double).to receive(:id).and_return(double.object_id)
end
}
end
@kainam00
kainam00 / rvm-amazon-linux.bash
Created July 31, 2015 15:31
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
@akora
akora / remove-diacritics-google-sheet
Created February 28, 2015 11:18
Removes all diacritics from strings (e.g. names) in a Google spreadsheet
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"ö","o"),"ü","u"),"ó","o"),"ő","o"),"ú","u"),"é","e"),"á","a"),"ű","u"),"í","i"),"Ö","O"),"Ü","U"),"Ó","O"),"Ő","O"),"Ú","U"),"É","E"),"Á","A"),"Ű","U"),"Í","I")
@johnbintz
johnbintz / simple-capistrano-docker-deploy.rb
Last active April 3, 2023 08:23
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@conf
conf / monkey_patches.rb
Created October 31, 2014 12:32
Monkey patch ActiveSupport::TimeZone to fix TZInfo::AmbiguousTime errors
# put this file in config/initializers/monkey_patches.rb
require 'monkey_patches/active_support/time_zone'