Skip to content

Instantly share code, notes, and snippets.

View olkarls's full-sized avatar

Ola Karlsson olkarls

View GitHub Profile
@MichaelBelgium
MichaelBelgium / wsl2-hosts-sync.ps1
Created June 5, 2020 07:46
WSL v2 windows hosts sync (powershell - updates domains to wsl2 ip)
# Requires -RunAsAdministrator
# Only works for WSL v2, this is completely not needed for WSL v1 where u always can use 127.0.0.1 in hosts file
Clear-Host
if ((Get-InstalledModule "Carbon" -ErrorAction SilentlyContinue) -eq $null) {
Install-Module -Name 'Carbon' -AllowClobber
}
Import-Module 'Carbon'
@parndt
parndt / who_do_you_work_for.rb
Created November 10, 2015 21:42
WHO DOES YOUR GEM WORK FOR?!
#!/usr/bin/env ruby
# Thanks, http://www.schneems.com/blogs/2015-09-30-reverse-rubygems/
require 'net/https'
require 'json'
require 'uri'
gem_name = ENV["GEM_NAME"]
def rubygems_get(gem_name: "", endpoint: "")
@xaviershay
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@tomkersten
tomkersten / somehost.conf
Created October 28, 2011 20:36
Nginx config with CORS headers added globally (for application w/ Basic Auth)
upstream your-app {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/your_app.socket fail_timeout=0;
}
server {
listen 80;
@grantmichaels
grantmichaels / Gemfile
Created September 5, 2011 05:44 — forked from ericallam/Gemfile
Using the Asset Pipeline outside of Rails - Serving CoffeeScript and SASS
source "http://rubygems.org"
gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git'
gem 'coffee-script'
gem 'sass'
gem 'rack-test'
gem 'sinatra'