Skip to content

Instantly share code, notes, and snippets.

View yallie's full-sized avatar

Alexey Yakovlev yallie

View GitHub Profile
@qwertie
qwertie / SimpleTimer.cs
Created September 25, 2013 21:36
A fast, simple alternative to System.Diagnostics.Stopwatch based on Environment.TickCount. Its resolution is typically 10-16 ms.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace Loyc
{
/// <summary>
/// A fast, simple timer class with a more convenient interface than
/// System.Diagnostics.Stopwatch. Its resolution is typically 10-16 ms.
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@velosipedist
velosipedist / postgresql-list-foreign-keys.sql
Created October 31, 2013 13:52
List all foreign keys in PostgreSQL database, analog of MySQL SHOW CREATE TABLE mytable;
--- Source: http://solaimurugan.blogspot.ru/2010/10/list-out-all-forien-key-constraints.html
SELECT
tc.constraint_name,
tc.constraint_type,
tc.table_name,
kcu.column_name,
tc.is_deferrable,
tc.initially_deferred,
rc.match_option AS match_type,
@rxaviers
rxaviers / gist:7360908
Last active May 13, 2026 14:57
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@pbojinov
pbojinov / README.md
Last active November 5, 2025 23:10
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@prabirshrestha
prabirshrestha / HelloWorldModule.cs
Last active September 15, 2016 09:29
Nancy ReactJS View Engine
using Nancy;
namespace NancyReactServerSide
{
public class HelloWorldModule : NancyModule
{
public HelloWorldModule()
{
// note: models are passed as reactjs props. ViewBag is ignored
Get["/"] = _ => View["hello", new { firstName = "Prabir", lastName = "Shrestha" }];
@nosamanuel
nosamanuel / upsert.sql
Created April 24, 2014 16:26
Simple upsert in Postgres using a writeable CTE
create table foo (id serial primary key, data json);
with updated_foo as (
update foo set data = '"bar"' where id = 1
returning id
)
insert into foo (id, data)
select 1, '"foo"'
where not exists(select id from updated_foo);
@staltz
staltz / introrx.md
Last active May 12, 2026 01:57
The introduction to Reactive Programming you've been missing
@nblumhardt
nblumhardt / Program.cs
Created June 25, 2014 21:52
Exception data enricher for Serilog
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Serilog;
using Serilog.Core;
using Serilog.Events;
using Serilog.Formatting.Json;
@CipherLab
CipherLab / EasyTimer
Created July 11, 2014 15:12
Javascript style interval/timeout in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DailyCoding.EasyTimer
{
public static class EasyTimer
{
public static IDisposable SetInterval(Action method, int delayInMilliseconds)