Skip to content

Instantly share code, notes, and snippets.

Avatar
🦅
microservice party

Daniel Pritchett ⚡ dpritchett

🦅
microservice party
View GitHub Profile
View downloadBuild2014Videos.ps1
[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)
View git-publish
#!/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"
View gist:8338490
def find_author(context)
context[:author].present? && news[:author].to_i != 0 ? @authors[context[:author].to_i][:email] : nil
end
View gist:8338838
# 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
View gist:8419942
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