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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
App::error(function(Exception $exception, $code) | |
{ | |
Log::error($exception->getMessage()); | |
switch ($code) { | |
case 404: | |
return Response::view('errors.404',array(), 404); | |
break; | |
default: |
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
import com.atlassian.jira.ComponentManager | |
import com.atlassian.jira.issue.CustomFieldManager | |
import com.atlassian.jira.issue.Issue | |
import com.atlassian.jira.component.ComponentAccessor | |
// Importing ModifiedValue & DefaultIsseuChangeHolder class to update fields via the script | |
import com.atlassian.jira.issue.ModifiedValue | |
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder |
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
# call script with: | |
# ruby scriptname.rb hieravar=value | |
require 'yaml' | |
# Get value to change hieravar=value | |
arg = ARGV[0].split('=') | |
field_name = arg[0] | |
field_value = arg[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
fixtures: | |
#repositories: | |
#stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git | |
#apt: git://github.com/puppetlabs/puppetlabs-apt.git | |
symlinks: | |
tomcat: "#{source_dir}" | |
authbind: "#{source_dir}/../authbind" | |
stdlib: "#{source_dir}/../stdlib" | |
apt: "#{source_dir}/../apt" |
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
# Alias for remote branch (f1 tracks feature_1) | |
git checkout --track -b f1 origin/feature_1 | |
# To enable push/pull to remote tracking branch (enables local(alias) branch to push to remote branch) | |
git config push.default upstream |
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
<!DOCTYPE html > | |
<html> | |
<!-- This was hacked together by hand after python-markdown output the bulk of it. | |
Maybe someday I'll put together a better script to aut-generate this from markdown source. --> | |
<head> | |
<!-- github-markdown, plus github pygments --> | |
<style type='text/css'> | |
/* <![CDATA[ */ | |
@font-face { | |
font-family: octicons-link; |
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
grep -rl 'apples' /dir_to_search_under | xargs sed -i 's/apples/oranges/g' |
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
sudo sed -i "s/^tenant.amount=1500/tenant.amount=2100/g" /opt/web/config.properties |
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
hiera <key> # to query common.yaml only | |
hiera <key> -m <FQDN> # to query config of a given node (using mcollective) | |
hiera <key> -i <FQDN> # to query config of a given node (using Puppet inventory) | |
hiera <key> environment=production fqdn=myhost1 # to pass values for hiera.yaml | |
# To dump complex data | |
hiera -a <array key> | |
hiera -h <hash key> |
OlderNewer