- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl
- GitHub Staff
- https://www.smockle.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'action_dispatch/middleware/static' | |
module Middleware | |
class FileHandler < ActionDispatch::FileHandler | |
def initialize(root, assets_path, cache_control) | |
@assets_path = assets_path.chomp('/') + '/' | |
super(root, cache_control) | |
end | |
def match?(path) |
Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).
nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include this in your .irbrc | |
def unbundled_require(gem, options = {}) | |
if defined?(::Bundler) | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last | |
if spec_path.nil? | |
warn "Couldn't find #{gem}" | |
return | |
end | |
spec = Gem::Specification.load spec_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost 127.0.0.1:80 | |
<VirtualHost 127.0.0.1:80> | |
ServerName pow | |
ServerAlias *.dev | |
ServerAlias *.xip.io | |
ProxyPass / http://localhost:20559/ | |
ProxyPassReverse / http://localhost:20559/ | |
ProxyPreserveHost On |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PdfMerger | |
def merge(pdf_paths, destination) | |
first_pdf_path = pdf_paths.delete_at(0) | |
Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf| | |
pdf_paths.each do |pdf_path| | |
pdf.go_to_page(pdf.page_count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpContext.Current.Response.BufferOutput = true; | |
HttpContext.Current.Response.ClearContent(); | |
HttpContext.Current.Response.ClearHeaders(); | |
HttpContext.Current.Response.AddHeader("Cache-control", "no-store"); | |
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=\"" + fileName + "\""); | |
HttpContext.Current.Response.ContentType = dr["MimeType"].ToString(); | |
HttpContext.Current.Response.AddHeader("Content-Length", fileblob.Length.ToString()); | |
HttpContext.Current.Response.BinaryWrite(fileblob); | |
HttpContext.Current.Response.Flush(); | |
HttpContext.Current.ApplicationInstance.CompleteRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DATABASE TYPES | |
# eg. field_name:field_type | |
:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean, :references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jonathantneal's polyfill for matchesSelector | |
if (this.Element) function(ElementPrototype) { | |
ElementPrototype.matches = ElementPrototype.matchesSelector = | |
ElementPrototype.matchesSelector || | |
ElementPrototype.webkitMatchesSelector || | |
ElementPrototype.mozMatchesSelector || | |
ElementPrototype.msMatchesSelector || | |
ElementPrototype.oMatchesSelector || | |
function (selector) { | |
var nodes = (this.parentNode || this.document).querySelectorAll(selector), i = -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash completion for Yeoman generators - tested in Ubuntu, OS X and Windows (using Git bash) | |
function _yo_generator_complete_() { | |
# local node_modules if present | |
local local_modules=$(if [ -d node_modules ]; then echo "node_modules:"; fi) | |
# node_modules in /usr/local/lib if present | |
local usr_local_modules=$(if [ -d /usr/local/lib/node_modules ]; then echo "/usr/local/lib/node_modules:"; fi) | |
# node_modules in user's Roaming/npm (Windows) if present | |
local win_roam_modules=$(if [ -d $(which yo)/../node_modules ]; then echo "$(which yo)/../node_modules:"; fi) | |
# concat and also add $NODE_PATH | |
local node_dirs="${local_modules}${usr_local_modules}${win_roam_modules}${NODE_PATH}" |
OlderNewer