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
module MyBase | |
def big_function | |
@_memoized_big_function ||= begin | |
load_lots_of_data(SettingsManager.foo_bar) | |
end | |
end | |
module_method :big_function | |
public :big_function | |
end |
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
jp2a picture.jpg --colors --invert | head -n20 | sed 's/\^[\[37m \^[\[0m/ /g' > picture.ansi |
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
# name: discourse-steam | |
# about: VALVE's Steam login support for Discourse | |
# version: 0.0.1 | |
# authors: Colin Shea | |
auth_provider :title => 'with Steam', | |
:authenticator => Auth::OpenIdAuthenticator.new('steam','http://steamcommunity.com/openid', trusted: true), | |
:message => 'Authenticating with Steam (make sure pop up blockers are not enabled)', | |
:frame_width => 1000, # the frame size used for the pop up window, overrides default | |
:frame_height => 800 |
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
#!/usr/bin/ruby | |
# Script to set up HipChat on every repository in an Organization. | |
# Is idempotent -- doesn't make a hook if there already is a HipChat | |
# notification set up. | |
require 'octokit' | |
## Settings | |
# What organization should we set up? |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
# A quick shell script that outputs "VULNERABLE!" if you are vulnerable, nothing | |
# otherwise. Meant to be used as part of an automated framework. | |
# | |
# Based on [bashcheck](https://github.com/hannob/bashcheck). | |
# | |
# These tests are *incomplete!* This is missing the tests for CVE-2014-6277 & | |
# CVE-2014-6278, as updated bashes aren't widely available yet, so they will | |
# always trigger. |
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
#!/bin/zsh | |
screens=($(screen -ls | head -n-2 | tail -n +2)) | |
# Zero index of an array is empty. Start at index 1. | |
#count=$(($#screens+1)) | |
#i=1 | |
#while [[ $i < $count ]]; do | |
# echo $screens[$i] $screens[$(($i+1))] | |
# i=$((i + 2)) | |
#done |
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
<html> | |
<head> | |
<title>WishList</title> | |
</head> | |
<body> | |
<h4>Wishlist for the Shea family</h4> | |
<? if @items == {} ?> | |
No items, go add one! | |
<? else ?> | |
<ul> |
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
undefined local variable or method `item' for #<MainController:0xb78e62e8> | |
view/index.xhtml:19:in `binding' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action.rb:109:in `binding' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action.rb:109:in `instance_eval' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action.rb:109:in `binding' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/template/ezamar.rb:24:in `transform' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action/render.rb:114:in `uncached_render' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action/render.rb:39:in `render' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action/render.rb:11:in `stack' | |
/usr/lib/ruby/gems/1.8/gems/ramaze-2008.11/lib/ramaze/action/render.rb:28:in `render' |
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 MainController < Ramaze::Controller | |
def index | |
@items = {} | |
# pp WishList.original | |
WishList.original.each do |id, tags| | |
@items[tags[:item]] = tags.reject {|k,v| k == :item } | |
end | |
pp @items | |
"List of all entires" | |
end |
OlderNewer