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.Runtime.Serialization.Json; | |
using System.IO; | |
using System.Text; | |
public static class JsonUtil | |
{ | |
/// <summary> | |
/// Serializes an object to the respectable JSON string. | |
/// </summary> | |
public static string Serialize<T>(T o) |
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.Runtime.Serialization.Json; | |
using System.Runtime.Serialization; | |
using System.Collections.Specialized; | |
using System.Text; | |
using System.Net; | |
using System.IO; | |
using Instasign.Models; | |
namespace Instasign |
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 class UnixTime | |
{ | |
public static int Get() | |
{ | |
return (int)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; | |
} | |
public static DateTime ToDateTime(int timestamp) | |
{ | |
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); |
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.Threading; | |
public sealed class IntervalTimer | |
{ | |
private Timer timer; | |
private Random rand; | |
private int min, max; | |
public event Action Interval; |
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 class Callbackr | |
{ | |
private static Dictionary<object, Action> callbacks = new Dictionary<object, Action>(); | |
/// <summary> | |
/// Adds the specified callback with the specified identifier. | |
/// </summary> | |
/// <param name="token">The callbacks specified identifier.</param> | |
/// <param name="callback">The callback to be added.</param> | |
public static void Add(object token, Action callback) |
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.Net; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
namespace SpeedClient | |
{ | |
public delegate void SpeedyDownloadProgressChangedEventHandler(SpeedyDownloadProgressChangedEventArgs e); | |
public delegate void SpeedyUploadProgressChangedEventHandler(SpeedyUploadProgressChangedEventArgs e); |
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.Text.RegularExpressions; | |
namespace System.Net.Mail | |
{ | |
/// <summary> | |
/// Provides an Electronic Mail (Email) address. | |
/// </summary> | |
public sealed class EmailAddress | |
{ | |
private const string EMAIL_PATTERN = @"([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*)@((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\.+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)"; |
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
<?PHP | |
class Csrfer { | |
const SESSION_NAME = 'csrfer_name'; | |
const SESSION_VALUE = 'csrfer_value'; | |
const TOKEN_FORMAT = '<input type=\'hidden\' name=\'%s\' value=\'%s\'>'; | |
const TOKEN_LENGTH = 128; | |
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
Imports System.Runtime.Serialization.Json | |
Imports System.IO | |
Imports System.Text | |
Public Class JsonUtil | |
''' <summary> | |
''' Serializes an object to the respectable JSON string. | |
''' </summary> | |
Public Shared Function Serialize(Of T)(o As T) As String | |
Dim s = New DataContractJsonSerializer(GetType(T)) |
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.CodeDom.Compiler; | |
using System.Collections.Generic; | |
using System.Resources; | |
using System.Text; | |
using Microsoft.CSharp; | |
using Microsoft.VisualBasic; | |
namespace PCompile | |
{ |
OlderNewer