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
var healAmount = 2; | |
var dangerThreshold = 10; | |
var safeDistance = 4; | |
var tryHeal = function(warrior, currHealth){ | |
warrior.isFleeing = warrior.isFleeing || false; | |
if(typeof warrior.lastHealth !== 'undefined' && | |
currHealth < warrior.lastHealth){ | |
if(warrior.stepsFromWall >= safeDistance && | |
currHealth < dangerThreshold) |
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
for (int i = 0; i < 16; i ++) | |
{ | |
byte bt = bytes[i]; | |
for (int b = 0; b < 8; b++) | |
{ | |
int bit = (bt >> b) & 1; | |
bits[(i * 8) + b] = (bool) bit; | |
} | |
} |
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
jQuery: | |
$('head').append('<style>.chatBody li>div { color: #eee }.chat, .chat-table tr, .chat-table td { background: #333; }.name {text-shadow:0 0 3px #000} a {color: #A4DB00; }</style>') | |
css: | |
.chatBody li>div { color: #eee }.chat, .chat-table tr, .chat-table td { background: #333; }.name {text-shadow:0 0 3px #000} a {color: #A4DB00; } |
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 -ne "\nShellshock: "; env x='() { :;}; echo -n not\ ' bash 2> /dev/null -c "echo patched"; bash --version | head -n1 |
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
private void CloseConnections(Action action) | |
{ | |
panel2.Dock = DockStyle.Fill; | |
panel2.Visible = true; | |
new Thread(() => | |
{ | |
Log("Closing connections..."); | |
foreach (TcpListener tl in tcpListeners) | |
{ | |
Log("- Closing listening socket " + tl.LocalEndpoint.ToString()); |
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
<configuration> | |
<system.web> | |
<rewrite> | |
<rules> | |
<rule name="Ember.js routing" stopProcessing="true"> | |
<match url=".*" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
</conditions> |
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
information: | |
name: My Check | |
version: 1.0 | |
website: http://dev.nesc.io/my-check | |
author: | |
name: Nomen Nescio | |
company: NN inc. | |
email: nomen@nesc.io | |
website: http://nesc.io |
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 ServiceProvider | |
{ | |
static Dictionary<Type, object> instances = new Dictionary<Type, object>(); | |
public static Nullable<T> GetService<T>() where T : struct | |
{ | |
var t = typeof(T); | |
if(instances.ContainsKey(t)) { | |
return new Nullable<T>((T)instances[t]); | |
} |
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
PM> Install-Package -Version 1.13.2 NetTopologySuite | |
Package 'NetTopologySuite.1.13.2' already exists in project 'Webvind3.WinForms' | |
PM> Install-Package HockeySDK.Core | |
Attempting to gather dependencies information for package 'HockeySDK.Core.2.2.2' with respect to project 'Webvind3.WinForms', targeting '.NETFramework,Version=v4.5' | |
Attempting to resolve dependencies for package 'HockeySDK.Core.2.2.2' with DependencyBehavior 'Lowest' | |
Install-Package : Unable to find a version of 'GeoAPI' that is compatible with 'NetTopologySuite 1.14.0 constraint: GeoAPI (≥ 1.7.4 && < 1.8.0)', 'ProjNET4GeoAPI 1.3.0.3 constraint: GeoAPI (≥ 1.7.1)', 'SharpMap 1.1.0 | |
constraint: GeoAPI (= 1.7.2)'. | |
At line:1 char:1 | |
+ Install-Package HockeySDK.Core |
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 DateTimeExtensions | |
{ | |
private static readonly DateTime _unixEpoch = new DateTime(1970, 1, 1); | |
public static long ToUnixTime(this DateTime dt) | |
{ | |
var span = dt - _unixEpoch; | |
return (long) (Math.Floor(span.TotalSeconds)); | |
} | |
} | |