Skip to content

Instantly share code, notes, and snippets.

View Tirael's full-sized avatar
🏠
Working from home

Georgiy Zhuykov Tirael

🏠
Working from home
  • Moscow, Moscow City, Russian Federation
View GitHub Profile
@oivoodoo
oivoodoo / mutex.js
Created December 28, 2011 12:05
mutex
var Mutex = function() {
this.queues = [];
this.locked = false;
};
Mutex.prototype = {
push: function(callback) {
var self = this;
this.queues.push(callback);
if (!this.locked) {
@rdingwall
rdingwall / CompositePresentationEventExtensions.cs
Created February 9, 2012 17:04
AsObservable() extension method for Prism's event aggregator
using System;
using Microsoft.Practices.Prism.Events;
// ReSharper disable CheckNamespace
namespace Microsoft.Practices.Prism.Events
// ReSharper restore CheckNamespace
{
public static class CompositePresentationEventExtensions
{
public static IObservable<TEventArgs> AsObservable<TEventArgs>(this CompositePresentationEvent<TEventArgs> @event)
@conradev
conradev / cycriptBot.py
Created June 4, 2012 05:03
Cycript IRC Bot
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
import sys, os, subprocess, tempfile
class CycriptBot(irc.IRCClient):
nickname = "cycriptbot"
def __init__(self):
self.process = "SpringBoard"
@StevenMcD
StevenMcD / TeamCity_helperFunctions.ps1
Created November 3, 2012 20:20
TeamCity - Powershell Helper functions
#############################
# Mercilessly copied from https://github.com/kvarv/Continuous-Delivery
#############################
function TeamCity-TestSuiteStarted([string]$name) {
Write-Output "##teamcity[testSuiteStarted name='$name']"
}
function TeamCity-TestSuiteFinished([string]$name) {
Write-Output "##teamcity[testSuiteFinished name='$name']"
@indyfromoz
indyfromoz / aspnet-mvc.gitignore
Created November 19, 2012 06:44
.Gitignore for ASP.NET MVC
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
@leommoore
leommoore / node_child_processes.markdown
Last active May 30, 2023 08:22
Node - Child Processes

#Node - Processes To launch an external shell command or executable file you can use the child_process. Apart from command line arguments and environment variables you cannot communicate with the process using child_process.exec. However you can use child_process.spawn to create a more integrated processes.

##Executing Child Processes

###To launch an external shell command

var child_process = require('child_process');
var exec = child_process.exec;
@plentz
plentz / nginx.conf
Last active August 31, 2026 22:25
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@dlidstrom
dlidstrom / Program.cs
Created February 4, 2014 14:56
Castle Windsor typed app settings
[AppSettings("smtp:")]
public interface SmtpConfiguration
{
string Name { get; set; }
int Port { get; set; }
string Username { get; set; }
}
@Rob--W
Rob--W / background.js
Created March 20, 2014 00:05
Implementation example of writable response bodies for Chromium extensions (API draft).
/**
* Implementation example of writable response bodies.
* Based on the draft of the Streams API (19 March 2014)
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm
* Design document for response body reading/writing:
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8
*/
/* globals chrome, ByteStream, URL, XMLHttpRequest */
'use strict';
@Kartones
Kartones / postgres-cheatsheet.md
Last active September 12, 2026 06:39
PostgreSQL command line cheatsheet

PSQL Cheatsheet

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)