Skip to content

Instantly share code, notes, and snippets.

View yallie's full-sized avatar

Alexey Yakovlev yallie

View GitHub Profile
@mengstr
mengstr / npm-packages-in-branches.txt
Last active May 6, 2021 11:16
How to store npm packages in github branches
#1) Create a new repo named "my-npm" and let github initialize it with a README (screenshot below)
#2) Clone it to your computer
git clone git@github.com:SmallRoomLabs/my-npm.git
#3) Go to the clone and create a new empty branch for the first package
cd my-npm
git checkout --orphan logger
#4) Delete all files in the folder
@pstoica
pstoica / OnBlurComponent.jsx
Last active September 9, 2024 05:14
onBlur for entire react element
function OnBlurComponent({ onBlur }) {
const handleBlur = (e) => {
const currentTarget = e.currentTarget;
// Check the newly focused element in the next tick of the event loop
setTimeout(() => {
// Check if the new activeElement is a child of the original container
if (!currentTarget.contains(document.activeElement)) {
// You can invoke a callback or add custom logic here
onBlur();
@olmobrutall
olmobrutall / gist:31d2abafe0b21b017d56
Last active December 21, 2020 09:42
Proposal for C# Non-Nullable Reference Types

Proposal for C# Non-Nullable Reference Types

This document tries to be an ordered compilation of the ideas exposed in https://roslyn.codeplex.com/discussions/541334

Also interesting is the original proposal I based my solution in http://twistedoakstudios.com/blog/Post330_non-nullable-types-vs-c-fixing-the-billion-dollar-mistake

And the uservoice suggestion to get Microsoft feel the urgency: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2320188-add-non-nullable-reference-types-in-c?page=3&per_page=20

Introduction

@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)
@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;
@staltz
staltz / introrx.md
Last active May 12, 2026 01:57
The introduction to Reactive Programming you've been missing
@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);
@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" }];
@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

@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: