Skip to content

Instantly share code, notes, and snippets.

View ioleksiy's full-sized avatar

Oleksii Glib ioleksiy

View GitHub Profile
@ioleksiy
ioleksiy / ePochtaSimpleDemo.cs
Created June 4, 2014 09:29
Using ePochta SMS Gateway
using System;
using Rest4Net.ePochta;
using Rest4Net.ePochta.Responses;
namespace ConsoleApplication1
{
class Program
{
// Provide yours here
private const string PublicKey = "public-key";
@ioleksiy
ioleksiy / versions.txt
Last active December 15, 2015 13:59
Installing PHP 5.2.17 On Ubuntu 10.04 LTS
php5-dev,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-dbg,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-curl,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-cli,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-cgi,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
libapache2-mod-php5filter,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
libapache2-mod-php5,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-xsl,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-xmlrpc,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
php5-tidy,php5-common 5.2.17.dfsg.1-0ubuntu0ppa3~lucid
@ioleksiy
ioleksiy / gist:4387663
Created December 27, 2012 11:47
Cordova (PhoneGap) iOS Security
- (NSString *)toMD5:(NSString *)data {
const char *cstr = [data UTF8String];
unsigned char result[16];
CC_MD5(cstr, strlen(cstr), result);
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
@ioleksiy
ioleksiy / 01.cs
Created May 10, 2012 15:36
Belz. Using AppHarbor as .Net worker mule
using System;
using System.Threading;
using Belz;
using Belz.QueueProvider;
using Belz.QueueProvider.IronMq;
using Prowlin;
namespace Daemon
{
class Program
@ioleksiy
ioleksiy / 01.cs
Created March 12, 2012 16:16
Extending Migrator.NET with logic scopes
// Classic usage
[Migration(1)]
public class Migration001 : Migration
{
public void Up() { }
public void Down() { }
}
// Same as classic (scope will be determined automatically => md5(typeof(Migration002).Assembly.GetName().Name))
[Migration(2, null)]
@ioleksiy
ioleksiy / 01.cs
Created March 5, 2012 11:33
Using MvcMiniProfiler with NancyFX
public class CustomBootstrapper : DefaultNancyBootstrapper
{
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
pipelines.BeforeRequest += PreRequest;
pipelines.AfterRequest += PostRequest;
}
private static Response PreRequest(NancyContext ctx)
@ioleksiy
ioleksiy / 01.cs
Created March 2, 2012 18:41
AcroDB. How to use
[AcroDbEntity]
public interface ICar
{
Guid ID { get; set; }
[AcroColumnStringLength(80)]
string Name { get; set; }
int YearOfAssembly { get; set; }
[AcroColumnStringLong]
string Description { get; set; }
}
@ioleksiy
ioleksiy / 01.cs
Created March 2, 2012 18:34
AcroDB. The beginning
using System;
using System.Reflection;
using AcroDB;
using AcroDB.Attributes;
using AcroDB.MongoDb;
using AcroDB.MsSql;
namespace AcroDBTest
{
[AcroDbEntity]
@ioleksiy
ioleksiy / 01.cs
Created March 2, 2012 18:29
AcroDB. Business Logic
[AcroDbEntity]
public interface IPage
{
Guid ID { get; set; }
Guid? IDPageParent { get; set; }
int Order { get; set; }
[AcroColumnStringLength(50)]
string Name { get; set; }
}
@ioleksiy
ioleksiy / 01.m
Created March 2, 2012 18:14
PhoneGap Application Encryption
- (void) fetchKey:(char[]) key
{
//ffffffffffffffffffffffffffffffff
key[0] = 0x66;
key[1] = 0x66;
key[2] = 0x66;
key[3] = 0x66;
key[4] = 0x66;
key[5] = 0x66;
key[6] = 0x66;