Skip to content

Instantly share code, notes, and snippets.

View pocheptsov's full-sized avatar

slava pocheptsov pocheptsov

View GitHub Profile
@jakebellacera
jakebellacera / ICS.php
Last active July 26, 2024 07:48
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@chaliy
chaliy / C#.sublime-build
Created March 18, 2012 21:17
Sublime Build to compile and run C# program
{
// This build system will build your cs file to exe file and will run it
"cmd": ["del ${file/\\.cs/\\.exe/} 2>NUL", "& csc /nologo /out:${file/\\.cs/\\.exe/} $file", "& ${file/\\.cs/\\.exe/}"],
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
// By default csc is not in your PATH, so add it to your path
// or uncomment "path" and check that it has correct value
//"path": "C:/Windows/Microsoft.NET/Framework64/v4.0.30319/",
"shell": true, // Without this sublime has hard times to parse "&" in out command line
"selector": "source.cs"
}
@amejiarosario
amejiarosario / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@chaliy
chaliy / Sample.proj
Created August 6, 2012 09:08
Code task to ZIP something
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0" DefaultTargets="Sample" >
<Import Project="Zip.targets" />
<Target Name="Sample" >
<Zip SourceFolder="C:\Users\Administrator.WIN-BOAS4C4GH8K\Projects\Temp" OutputFileName="package.zip" />
</Target>
</Project>
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@Restuta
Restuta / gist:4289538
Created December 14, 2012 23:23
Sublime Plugin that does auto-save of the current document when you stop typing. Can be used with LiveReload to remove the need to press Ctrl+S all the time.
import sublime, sublime_plugin, functools
class IdleWatcher(sublime_plugin.EventListener):
pending = 0
def handleTimeout(self, view):
self.pending = self.pending - 1
if self.pending == 0:
self.on_idle(view)
@anvaka
anvaka / quine1.js
Last active December 12, 2015 10:18
Just having fun... This function prints itself to the console.
(function () {
var arr = ["(function () {", "var arr = [", "arr[1] += arr.map(function(x) { return String.fromCharCode(0x22) + x + String.fromCharCode(0x22); }).join(', ') + '];';", "arr.forEach(function(x) { console.log(x); });", "}())"];
arr[1] += arr.map(function(x) { return String.fromCharCode(0x22) + x + String.fromCharCode(0x22); }).join(', ') + '];';
arr.forEach(function(x) { console.log(x); });
}())
@yevhen
yevhen / gist:5199613
Created March 19, 2013 20:07
The concept of message handling Component and the example of message handler chaining via functional composition
/* somewhere in your Core.CQRS */
// Base class for all ES-based aggregate command handling components;
//
// NOTE: "Component" is a logical grouping of message handlers by function
// They provide good place to encapsulate chaining of cross-cutting concerns
// into a pipeline, providing simplified helper methods for registration of message handlers
//
// Components are similar to Services, thus they only contain handlers of single type (ie Command Handlers only)
// Components operate on envelope (infrastructure) level