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
internal system techtribes.je | |
desc techtribes.je is the only way to keep up to date with the IT, tech and digital sector in Jersey and Guernsey, Channel Islands | |
uses Twitter | |
Gets profile information and tweets from. | |
uses Github | |
Gets information about public code repositories from. | |
uses Blogs | |
Gets content using RSS and Atom feeds from. | |
container Web Application | |
desc Allows users to view people, tribes, content, events, jobs, etc from the local tech, digital and IT sector. |
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
internal system techtribes.je | |
desc techtribes.je is the only way to keep up to date with the IT, tech and digital sector in Jersey and Guernsey, Channel Islands | |
uses Twitter | |
Gets profile information and tweets from. | |
uses Github | |
Gets information about public code repositories from. | |
uses Blogs | |
Gets content using RSS and Atom feeds from. | |
external person Anonymous User |
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
// With massive help from http://securityxploded.com/iepasswordsecrets.php | |
var urlBytes = System.Text.Encoding.Unicode.GetBytes((url + '\0').ToLower()); | |
byte[] hashBytes; | |
using(var sha1 = new SHA1Managed()) | |
hashBytes = sha1.ComputeHash(urlBytes); | |
var checksum = hashBytes.Aggregate((x,y) => (byte)((int)x + (int)y)); | |
var keyBytes = hashBytes.Concat(new[] { checksum }).ToArray(); | |
var regKey = String.Join("", keyBytes.Select(x => x.ToString("X2"))); |
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 void Tick(IAgentUpdateInfo agentUpdate) | |
{ | |
if (agentUpdate.Node.OpposingAgents.Any()) FightOrFlight(agentUpdate); | |
else SeekEnemiesAndBuffUp(agentUpdate); | |
} | |
private void FightOrFlight(IAgentInfo agentInfo) | |
{ | |
if (IsOutnumbered(agentInfo) || IsOutgunned(agentInfo)) Move(agentInfo, FleeStrategy); | |
else Fight(agentInfo); | |
} |
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
if (EnemiesOf(self).Any()) | |
if (!IsConfident(self) && CanMove(self)) Move(self, Fleeing); | |
else Fight(EnemiesOf(self)); | |
else if (IsInjured(self)) Heal(); | |
else if (IsBuffed(self) && CanMove(self)) Move(self, Hunting); | |
else Buff(); |
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.Threading; | |
namespace MagicUI.Framework | |
{ | |
public static class Execute | |
{ | |
[ThreadStatic] | |
private static bool _isUiThread; |
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
interface IUpdaterUI { | |
void UpdateStatus(int? progress = null, string message = null); | |
void SoftwareUpdateComplete(); | |
void DataUpdateComplete(); | |
} | |
class MyForm : IUpdaterUI { | |
public void UpdateStatus(int? progress = null, string message = null) { | |
if(progress.HasValue) SetProgress(progress.Value); | |
if(message != null) MessageLabel.Do(ctl => ctl.Text = message); |
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 interface ISequencerToken | |
{ | |
bool IsCurrent { get; } | |
} | |
public class Sequencer | |
{ | |
private long _currentToken = 0; | |
private long Bump() |
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 interface IConfig | |
{ | |
string Get(string key); | |
} | |
public class Config : IConfig | |
{ | |
public string Get(string key) | |
{ | |
var fromConfig = ConfigurationManager.AppSettings[key]; |
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 inputFile = @"whatever.xml"; | |
var outputFile = @"whatever.updated.xml"; | |
BlogMLBlog blog; | |
using (var reader = new StreamReader(inputFile)) | |
blog = BlogMLSerializer.Deserialize(reader); | |
var usedNames = new List<string>(); | |
foreach(var post in blog.Posts.OrderBy(p => p.DateCreated)) | |
{ |
OlderNewer