JSConf.eu opening song - JavaScript Will Listen - Bella Morningstar
- Plask - Dean McNamee
- Plask
React.if = function(cond, trueCallback, falseCallback) { | |
if(cond && typeof trueCallback === 'function') { | |
return trueCallback(); | |
} | |
else if(!cond && typeof falseCallback === 'function') { | |
return falseCallback(); | |
} | |
}; | |
// Example usage |
C:\installs\trunk3_installed>cd bin | |
C:\installs\trunk3_installed\bin>rake -T | |
C:/installs/trunk3_installed/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception) | |
from C:/installs/trunk3_installed/bin/rake:19:in `<main>' | |
C:\installs\trunk3_installed\bin>cd .. | |
C:\installs\trunk3_installed>cat ./lib/ruby/gems/1.9.1/specifications/rake.gemspec | |
Gem::Specification.new do |s| |
using System; | |
using System.Globalization; | |
using System.Web.Mvc; | |
namespace Zomg.Web.ModelBinders | |
{ | |
public class Iso8601DateTimeBinder : DefaultModelBinder | |
{ | |
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) | |
{ |
pik_info() { | |
version= pik info | awk '/full_version/ {print $2,$3}' | sed 's/\"//;s/\s/\-/' | |
printf "${version}" | |
} | |
function prompt { | |
local LIGHT_RED="\[\033[1;31m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local NO_COLOUR="\[\033[0m\]" |
public static class DateTimeHelpers | |
{ | |
private static readonly string[] Iso8601Format = new[] | |
{ | |
"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", | |
@"yyyy-MM-dd\THH:mm:ssK" | |
}; | |
//SortableDateTimePattern (ISO 8601) | |
public static string ToIso8601(DateTime value) |
using System.Web; | |
namespace NetflixDemo | |
{ | |
public class AppHarborHttpContextWrapper : HttpContextWrapper | |
{ | |
private readonly HttpContext httpContext; | |
public AppHarborHttpContextWrapper(HttpContext httpContext) : base(httpContext) | |
{ |
// unixtime stamps from server are PT, need to make them UTC | |
var getAdjustedDate = function ( unixtime ) { | |
if ( !unixtime ) { return new Date(); } | |
var date, dst, offset; | |
// create date object | |
if ( typeof unixtime === 'number' ) { | |
date = new Date( unixtime * 1000 ); | |
} else if ( typeof unixtime === 'string' ) { | |
unixtime = parseInt( unixtime, 10 ); | |
date = new Date( unixtime * 1000 ); |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- #### NOTE #### --> | |
<!-- To build with Mono's xbuild on bash, you must execute [`sudo install-nuget.sh`](https://gist.github.com/2595337) first. --> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | |
<!-- Windows specific commands --> |
function global:ExposeIIS() | |
{ | |
$config = [xml] ( get-content $env:IIS_USER_HOME/config/applicationhost.config ) | |
# Add in new bindings for computer name | |
foreach($site in $config.configuration."system.applicationHost".sites.site) | |
{ | |
foreach($bindings in $site.bindings) | |
{ | |
# no need to add another binding for machine name if its exists |