Skip to content

Instantly share code, notes, and snippets.

View dpritchett's full-sized avatar
🦅
microservice party

Daniel Pritchett ⚡ dpritchett

🦅
microservice party
View GitHub Profile
#!/usr/bin/env ruby
cmds = []
cmds << "git co gh-pages"
cmds << "git merge master"
cmds << "git push origin gh-pages"
cmds << "git co master"
cmds << "git push origin master"
cmds << "git push joyent master"
def find_author(context)
context[:author].present? && news[:author].to_i != 0 ? @authors[context[:author].to_i][:email] : nil
end
# bigger, easy to debug
def find_author(context)
context = context.to_i
return if context.zero?
author = @authors.fetch(context)
return unless !!author
author.fetch(:email)
end
class FranchiseeRequest < ActiveRecord:: Base
attr_accessor :skip_region_validation
attr_accessor :skip_region_validation, as: :import
validate :expanding_into_region, unless: !!ENV["IMPORT_HAX_LOL"]
def expanding_into_region
raise error if franchise is not expanding into current region
end
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2014/RSS/mp4high"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-") + "-" + $_.creator + ".mp4"
if (!(test-path $file))
{
$file
$wc = (New-Object System.Net.WebClient)