Skip to content

Instantly share code, notes, and snippets.

View gist:abe4ac9c086290ccb5e6757bb7ffa52f
### Keybase proof
I hereby claim:
* I am fastjames on github.
* I am fastjames (https://keybase.io/fastjames) on keybase.
* I have a public key ASDL6YrtoFS2096KuJbS1spHSAt10hIUDVR8vWgazzHQMgo
To claim this, I am signing this object:
@fastjames
fastjames / reclaimWindows10.ps1
Last active Jan 10, 2017 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
View reclaimWindows10.ps1
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@fastjames
fastjames / math_mean.exs
Created Aug 7, 2015
Probably bad mean in elixir
View math_mean.exs
defmodule FastMath do
def mean([]), do: 0
def mean([a]), do: a
def mean(list) do
_mean(list, 0, 0)
end
# terminal condition
defp _mean([], total, count) do
View Unicorn_and_Upstart.md

Using Unicorn with Upstart

This configuration works with Upstart on Ubuntu 12.04 LTS

The reason why it needs to be done this way (i.e. with the pre-start and post-stop stanzas), is because Upstart is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys and run Unicorn in foreground also, it then only needs one exec stanza.

This presumes you are not using RVM, so no voodoo dances.

@fastjames
fastjames / gist:2725983
Created May 18, 2012 — forked from dignoe/gist:2485272
Patch to get content_for working with action caching and fragment caching in Rails 3.1
View gist:2725983
module ActionController
class Metal
attr_internal :cached_content_for
end
module Caching
module Actions
def _save_fragment(name, options)
return unless caching_allowed?