Skip to content

Instantly share code, notes, and snippets.

View radleta's full-sized avatar

Richard Adleta radleta

View GitHub Profile
@radleta
radleta / dynamic-dynamodb.conf
Last active January 25, 2017 14:17
Example of dynamic-dynamodb.conf
[global]
region: us-east-1
# Important: The combination of the below check interval and num-read-checks-before-scale-down
# or num-write-checks-before-scale-down should never cause more than 24 decreases
# in a given 24 hour period due to DynamoDB restriction of only 24 decreases per
# 24 hours.
check-interval: 60
[logging]
log-level: info
@radleta
radleta / NugetPackageManagerConsoleSelectProjectsThenInstallPackage.ps1
Created May 15, 2015 13:05
Nuget Package Manager Console Commands To Selected Projects With Package Then Install Package
$projects = Get-Project -All | Select @{ Name="ProjectName";Expression={$_.ProjectName}}, @{Name="Has";Expression={Get-Package Microsoft.AspNet.Mvc -ProjectName $_.ProjectName}} | where { $_.Has -like '*Microsoft.AspNet.Mvc*' }
$projects | select { Install-Package -Id Microsoft.AspNet.WebHelpers -ProjectName $_.ProjectName }
@radleta
radleta / ElevatorSagaChallenge5.js
Created January 23, 2015 14:20
Elevator Saga Challenge #5
// URL: http://play.elevatorsaga.com/#challenge=5
{
init: function(elevators, floors) {
function initElevator(elevator) {
elevator.on("idle", function() {});
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum);
});
elevator.on("passing_floor", function(floorNum, direction) {
@radleta
radleta / ElevatorSagaChallenge4.js
Created January 23, 2015 13:07
Elevator Saga Challenge #4
// URL: http://play.elevatorsaga.com/#challenge=4
{
init: function(elevators, floors) {
function initElevator(elevator) {
elevator.on("idle", function() {});
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum, true);
});
elevator.on("passing_floor", function(floorNum, direction) {
@radleta
radleta / ElevatorSagaChallenge3.js
Created January 23, 2015 13:05
Elevator Saga Challenge #3
// URL: http://play.elevatorsaga.com/#challenge=3
{
init: function(elevators, floors) {
function initElevator(elevator) {
elevator.on("idle", function() {});
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum, true);
});
elevator.on("passing_floor", function(floorNum, direction) {
@radleta
radleta / ElevatorSagaChallenge2.js
Created January 23, 2015 12:30
Elevator Saga Challenge #2
{
init: function(elevators, floors) {
var elevator = elevators[0]; // Let's use the first elevator
elevator.on("idle", function() {
// The elevator is idle, so let's go to all the floors (or did we forget one?)
elevator.goToFloor(2);
});
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum, true);
});
@radleta
radleta / ElevatorSagaChallenge1.js
Created January 23, 2015 12:17
Elevator Saga Challenge #1
{
init: function(elevators, floors) {
var elevator = elevators[0]; // Let's use the first elevator
elevator.on("idle", function() {
// The elevator is idle, so let's go to all the floors (or did we forget one?)
elevator.goToFloor(0);
});
elevator.on("floor_button_pressed", function(floorNum) {
elevator.goToFloor(floorNum, true);
});
@radleta
radleta / NearestHour.sql
Created December 24, 2013 13:25
Round DateTime to nearest hour. Useful when grouping by DateTime to round to the nearest hour.
SELECT dateadd(hour, datediff(hour, 0, GETDATE()), 0) NearestHour
@radleta
radleta / NearestMinute.sql
Created December 24, 2013 13:23
Round DateTime to Nearest Minute. Useful when grouping by DateTime to round to the nearest minute.
SELECT DATEADD(MINUTE, 1+DATEDIFF(MINUTE, 0, GETDATE()), 0) NearestMinute
@radleta
radleta / List-Inline-Bullet-Seperated.less
Created February 27, 2013 12:59
Less Styles for an unordered inline list with the items seperated by bullets.
// Inline unordered list seperated by bullets
ul.list-inline-bullet-seperated
{
list-style-type: none;
li
{
display: inline-block;
}
li:before
{