Skip to content

Instantly share code, notes, and snippets.

@octan3
octan3 / backgroundColor-alpha-blend.js
Created February 1, 2013 13:01
Animate the backgroundColor-opacity-value.
$.fx.step.backgroundColor = function(fx) {
if (!fx._init) {
// parse RGBA-Color
var col = /\((\d+,\s*\d+,\s*\d+),\s*([\d\.]+)\s*\)/.exec($.css(fx.elem, 'backgroundColor'));
// set correct start-value
fx.start = parseFloat(col[2]);
@octan3
octan3 / json-parser.ps1
Created August 4, 2011 11:46
PowerShell JSON Parser (compact)
$code = "static function parseJSON(json) {return eval('(' +json + ')');}"
$JSONUtil = (Add-Type -Language JScript -MemberDefinition $code -Name "JSONUtil" -PassThru)[1]
$obj = $JSONUtil::parseJSON($jsonString)
@octan3
octan3 / cookiecatcher.ps1
Created August 4, 2011 11:42
PowerShell HTTP Cookie Catcher (WebRequest, SSL Certificate Validation Check, Expect 100)
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
[Net.ServicePointManager]::Expect100Continue = $false
$cc = new-object Net.CookieContainer
$req = [Net.WebRequest]::Create("https://www.example.com/service")
$req.CookieContainer = $cc
$req.Method = 'POST'
$req.Timeout = 5000
$req.ContentType = 'application/x-www-form-urlencoded'