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
enum Test { | |
one, | |
two, | |
three | |
} | |
interface EnumIterator<TEnum extends number> { | |
iterate(myEnum: TEnum, callback: (value: number, name: string) => void): void; | |
} |
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
var chunkSize = 5, batchMod = Math.pow(10, chunkSize); | |
function getChunks(num) { | |
var chunks = [], | |
count = 0; | |
while (true) { | |
var length = chunkSize, | |
shouldBreak = false; | |
var startIndex = num.length - chunkSize * ++count; | |
if (startIndex < 0) { |
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
/// <reference path="../typings/tsd.d.ts" /> | |
import * as assert from 'assert'; | |
import annotest from '../index'; | |
import IPerson from './IPerson'; | |
@annotest.ModuleDecorator('Person tests', {'./IsEighteenOrOlder': {default:(age: number) => age > 19}}) | |
class MyCustomTest { | |
@annotest.TestMethodDecorator('Testing person constructor') |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../chart-js/chart-js.html"> | |
<polymer-element name="my-element"> |
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
Beginning activity, Data: [{"name":"PAGE_START","parent":null,"isComplete":false,"id":"55c5dfdc-1c6f-3ebb-c1ce-895322e4e83d"}], ActivityId: [null], ParentActivityId: [null] testApp.js:88 | |
Beginning activity, Data: [{"name":"testController.INITIALIZE","parent":{"name":"PAGE_START","parent":null,"isComplete":false,"id":"55c5dfdc-1c6f-3ebb-c1ce-895322e4e83d"},"isComplete":false,"id":"a516d955-0105-3e36-b69d-bf1316bfd2d3"}], ActivityId: [55c5dfdc], ParentActivityId: [null] testApp.js:88 | |
Setting $scope.currentDateTime to the current time: [Mon Dec 09 2013 08:52:18 GMT-0800 (PST)], Data: [undefined], ActivityId: [a516d955], ParentActivityId: [55c5dfdc] testApp.js:88 | |
Completing activity, Data: [{"activityName":"testController.INITIALIZE"}], ActivityId: [55c5dfdc], ParentActivityId: [null] testApp.js:88 | |
logging something while in a timeout which should be outside initialize scope, Data: [undefined], ActivityId: [55c5dfdc], ParentActivityId: [null] testApp.js:88 | |
Appending to activity, Data: [{"name":"testControll |
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
var initializeActivity = loggerService.startActivity(activities.testController.INITIALIZE); | |
$scope.currentDateTime = new Date(); | |
loggerService.log('Setting $scope.currentDateTime to the current time: [' + $scope.currentDateTime + ']'); | |
loggerService.endActivity(activities.testController.INITIALIZE); | |
$timeout(function () { | |
loggerService.log('logging something while in a timeout which should be outside initialize scope'); | |
}); |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace ExceptionVsOutParamBenchmark | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
def intersect_arrays(arrays) | |
result = [] | |
init = false | |
massaged_array = arrays.compact.uniq || [] | |
massaged_array.each do |a| | |
unless init | |
result = a | |
init = true | |
else | |
result = result & a |
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
#!/bin/bash | |
echo "Installing dependencies" | |
sudo apt-get install ruby curl bison build-essential autoconf zlib1g-dev libssl-dev libxml2-dev libreadline6-dev git-core subversion sqlite3 | |
echo "Installing RVM" | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
echo "Configuring RVM" |
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
#Rails.application.config.session_store :cookie_store, :key => '_bloggit_session', :domain => :all | |
Rails.application.config.session_store :cookie_store, :key => '_bloggit_session', :domain => '.example.com' |
NewerOlder