This file contains hidden or 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.Collections.Specialized; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Security.Principal; | |
using System.Text; | |
using System.Threading; |
This file contains hidden or 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
class Percolation extends WeightedQuickUnionUF { | |
private int width; | |
public Percolation(int n) { | |
super(n * n + 2); | |
for(int i = 0; i < n; i++) { | |
union(1 + n * (n - 1) + i, n * n + 1); | |
} | |
width = n; | |
} |
This file contains hidden or 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 table() | |
{ | |
var keys = [], | |
vals = []; | |
function indexOf(key) { | |
return keys.indexOf(key); | |
} | |
function get(key) { |
This file contains hidden or 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
Console.WriteLine("Enter username and password (a line for each)"); | |
ISession session = await Spotify.CreateSession(key, cache, settings, userAgent); | |
session.MusicDeliver += session_MusicDeliver; | |
await session.Login(Console.ReadLine(), Console.ReadLine(), false); | |
session.SetPrefferedBitrate(sp_bitrate.BITRATE_320k); | |
await session.PlaylistContainer; | |
var playlist = await session.PlaylistContainer[0]; | |
Console.WriteLine("Playing first from " + playlist.Name); |
This file contains hidden or 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
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin | |
cinst GoogleChrome | |
cinst firefox | |
cinst msysgit | |
cinst nodejs.install | |
cinst vlc | |
cinst sublimetext2 | |
cinst fiddler4 |
This file contains hidden or 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
internal static class DatabaseExtensions | |
{ | |
public static bool HasColumn(this IDataRecord reader, int columnNumber) | |
{ | |
return reader.FieldCount > columnNumber && columnNumber >= 0; | |
} | |
public static bool HasColumn(this IDataRecord reader, string columnName) | |
{ | |
for (int i = 0, l = reader.FieldCount; i < l; i++) |
This file contains hidden or 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.Linq; | |
using System.Linq.Expressions; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Tests | |
{ | |
using System; |
This file contains hidden or 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 IFakeOptionsBuilder<TFaked> CallBase<TFaked>(this IFakeOptionsBuilder<TFaked> config) | |
{ | |
return config.Strict() | |
.OnFakeCreated(fake => | |
A.CallTo(fake).Where(c => !c.Method.IsFinal && !c.Method.IsAbstract) | |
.CallsBaseMethod()); | |
} |
This file contains hidden or 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/sh | |
if test `uname` = Darwin; then | |
# Running on mac | |
brew update | |
brew install mono | |
else | |
# Running (presumably) on linux | |
# sudo add-apt-repository -y ppa:directhex/monoxide | |
This file contains hidden or 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.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Runt.Bootstrap | |
{ |