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
[].slice.call(document.querySelectorAll('.ng-scope')).map((x) => angular.element(x)).filter(x => x.scope().$id == 20) |
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 Base64DateTimeHelpers | |
{ | |
public static string ToBase64(this DateTimeOffset dateTimeOffset) | |
{ | |
var seconds = dateTimeOffset.ToUnixTimeSeconds(); | |
var buffer = BitConverter.GetBytes(seconds); | |
return Convert.ToBase64String(buffer); | |
} | |
public static string ToBase64UrlSafe(this DateTimeOffset dateTimeOffset) |
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
Convert.ToBase64String(BitConverter.GetBytes(4544564654654656546L)).Replace('+','-').Replace('/','_').TrimEnd('=') |
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
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$server, | |
[Parameter(Mandatory=$false)] | |
[pscredential]$credential | |
) | |
[string] $username = $null | |
[string] $password = $null |
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
\[DataMember\]([\s\r\n]+[^\s\r\n]+[\s\r\n]+[^\s\r\n]+[\s\r\n]+)([^\s\r\n]+) | |
[DataMember(Name ="$2")]$1$2 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function Format-Colors { | |
Param( | |
[Parameter(Position=0, Mandatory=$true)] | |
[string] $Format, | |
[Parameter(Position=1)] | |
[object] $Arguments | |
) | |
if($Arguments -is [string]) {$Arguments = ,($Arguments)} | |
$result = Select-String -Pattern '\{(?:(\d+)(?::(\d|[0-9a-zA-Z]+))?)\}' -InputObject $Format -AllMatches |
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
<html ng-app> | |
<head> | |
<title>Visual Studio 2012 Colors</title> | |
<style> | |
body > p > span { | |
width: 90px; | |
border: 2px solid black; | |
display: inline-block; | |
font: 10pt 'Courier New', 'Courier', 'monospace'; | |
text-align: center; |
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
@echo off | |
set HANDBRAKE="C:\Program Files\Handbrake\HandBrakeCLI.exe" | |
for /r %%a in (*.avi *.mkv *.wmv *.divx *.mpg *.mpeg *.m4v *.ogg) do %HANDBRAKE% -i "%%~a" -o "%%~dpna_.mkv" -e x264 -q 20 -E faac -B 128 --x264-preset medium --x264-profile main -x level=4.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
function dumpObject(root, indent){ | |
if(indent == null) indent = " "; | |
function toType(obj) { | |
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1]; | |
} | |
var queue = [{ data: root, level: 0 }]; | |
function add(data, level, prepend) { | |
queue.push({data: data, level: level, prepend: prepend}); |
NewerOlder