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
$files = Get-ChildItem | Sort-Object LastWriteTime | |
For ($i=0; $i -lt $files.Length; $i++) { | |
$from = $files[$i].Name | |
$to = "$($i.ToString('000')) $from" | |
Write-Host "Renaming `"$from`" to `"$to`"" | |
Rename-Item $from $to | |
} |
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
public static class Base36 | |
{ | |
private const string Digits = "0123456789abcdefghijklmnopqrstuvwxyz"; | |
private const string Max = "1y2p0ij32e8e7"; | |
/// <summary> | |
/// Converts from base 10 to base 36. | |
/// </summary> | |
/// <param name="value">Value to convert</param> |
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.Text.RegularExpressions; | |
public static class EnumSnakeCaseExtensions | |
{ | |
public static string ToSnakeCase(this Enum value) | |
{ | |
return Regex.Replace(value.ToString(), @"(\p{Ll})(\p{Lu})", "$1_$2").ToLower(); | |
} |
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
// These values are specific to the problem I was solving | |
const GRID_SIZE = 6; | |
const BLOCK_CELL_INDICES = [[0, 6], [1, 2], [3, 4], [5, 11], [7, 13], [8, 14], [9, 15], [10, 16], | |
[12, 18], [17, 23], [19, 20], [21, 22], [24, 25], [26, 32], [27, 33], [28, 29], [30, 31], [34, 35]]; | |
const BLOCK_RULES = [[1, '-'], [3, '/'], [4, '-'], [4, '-'], [4, '-'], [1, '-'], [5, '+'], [2, '-'], [10, '*'], | |
[2, '-'], [2, '/'], [2, '-'], [6, '*'], [1, '-'], [3, '-'], [2, '/'], [4, '-'], [3, '-']]; | |
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
<!doctype html> | |
<html ng-app> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular.min.js"></script> | |
<script src="http://www.cornify.com/js/cornify.js"></script> | |
<style> | |
#cornifycount { | |
display: none; | |
} |
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.ComponentModel; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
public static class EnumHelper | |
{ | |
public static IDictionary<int, string> ToDictionary(this Type enumType) | |
{ |
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
System.Net.ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true; |
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
ng lint | |
errorlevel=$? | |
if [ $errorlevel -ne 0 ] | |
then | |
echo "##teamcity[buildProblem description='Lint errors found, see Build Log for details']" | |
fi |
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
git config --global remote.origin.prune true | |
git config --global alias.lg "log --oneline --graph --decorate" | |
git config --global color.ui.auto true | |
git config --global color.status.added "green normal bold" | |
git config --global color.status.changed "red normal bold" | |
git config --global color.status.updated "green normal bold" | |
git config --global color.status.untracked "yellow normal bold" | |
git config --global color.branch.remote "red normal bold" | |
git config --global color.branch.local "magenta normal bold" | |
git config --global color.diff.old "red bold" |
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
String.prototype.cleanMoney = function() { | |
return this.replace('-', '').replace('£', '').replace(',', ''); | |
} | |
var csv = ''; | |
var trs = $('#filterable-ftb tr'); | |
for (var index = 1; index < trs.length; index++) { | |
var tr = trs[index]; | |
var col0 = $('td[headers=header-date]', tr).text().trim(); |