Skip to content

Instantly share code, notes, and snippets.

{
Start: "2014-01-01 00:00:01",
End: "2014-01-31 00:00:01",
TotalWorkedHours: "01:02:03",
TotalBreakHours: "01:02:03",
Days: [
{
Date: "2014-01-01 00:00:01",
TotalWorkedHours: "01:02:03",
@abergs
abergs / MyModel.ts
Created February 24, 2014 21:13
Typescript AMD example
class MyModel {
public ID: number;
public Value: string;
}
export = MyModel;
@abergs
abergs / AllowOneConcurrentAttribute.cs
Last active March 21, 2017 17:01
AllowOneConcurrent
using System;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Caching;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
/// <summary>
/// Decorates any Action that needs to have client requests limited by concurrent requests.
@abergs
abergs / pswlauc
Created August 6, 2014 22:12
Powershell Launcher
$paths = "$env:APPDATA\Microsoft\Internet Explorer\Quick Launch", "C:\ProgramData\Microsoft\Windows\Start Menu", "$env:APPDATA\Microsoft\Windows\Start Menu"
$searchword =$args[0]
$otherargs = $args[1..100]
Write-Host $otherargs
foreach ($path in $paths) {
$applications = Get-ChildItem $path -recurse -File -Filter $searchword*
$applicationPath = @($applications | ForEach-Object -Process {$_.FullName})
@abergs
abergs / rdel.ps1
Last active August 23, 2016 20:03
Remove node_modules
# By Anders and Henkan 2014-08-07 v1
# http://ideasof.andersaberg.com
$path = $args[0]
$chars = "abcdefghijklmnopqrstuvwxyz"
function GetFileName($num)
{
$name = ""
while($num -gt 25) {
@abergs
abergs / v0 API proposal
Last active August 29, 2015 14:05
TableViewComponent
// version 0.0.1 of TableViewcomponent API
<TableView>
<Columns>
<Column format="%s kg" />
<Column format="%s" />
</Columns>
<Rows>
{Items}
</Rows
</TableView
var SomeView = React.createClass({
render: function () {
return (
<ColumnLayout expanded={true} somethingElse={this.state.stuff}>
<Column text={this.state.text} onClick={this.props.onClick} focus={this.state.isFocus} />
....
</ColumnLayout>
);
@abergs
abergs / package.json
Created March 24, 2015 07:48
Webpack
{
"name": "env1",
"main": "app/main.jsx",
"version": "0.1.0",
"description": "Whatever",
"dependencies": {
"events": "~1.0.2",
"express": "~4.12.0",
"fastclick": "~1.0.6",
"invariant": "~2.0.0",
using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>;
public class NewRelicIgnoreTransactionOwinModule
{
private AppFunc _nextAppFunc;
public NewRelicIgnoreTransactionOwinModule(AppFunc nextAppFunc)
{
_nextAppFunc = nextAppFunc;
}
@abergs
abergs / Get data.js
Created November 23, 2015 09:17
Feedrepublic
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
$.getJSON( "http://feedrepublic.azurewebsites.net/api/popular-filters-global/", function( data ) {
// put data into the graph
data= data.slice(0,5);
data.unshift(["filter","number"]);
var dataTable = google.visualization.arrayToDataTable(data);