Skip to content

Instantly share code, notes, and snippets.

View sergeyt's full-sized avatar
:electron:
There is a time for everything, a time to search and, a time to give up...

Sergey Todyshev sergeyt

:electron:
There is a time for everything, a time to search and, a time to give up...
View GitHub Profile
@sergeyt
sergeyt / meteor-typeahead-async-data-source.html
Last active December 31, 2015 22:39
gist for meteor-typeahead demo
<input class="form-control typeahead" name="emails" type="text"
placeholder="emails" autocomplete="off" spellcheck="off"
data-source="emails"/>
@sergeyt
sergeyt / meteor-typeahead-emails.js
Last active December 31, 2015 22:39
gist for meteor-typeahead demo
if (Meteor.isServer){
Meteor.methods({
emails: function(){
return ['[email protected]'];
}
});
}
if (Meteor.isClient){
Template.demo.emails = function() {
@sergeyt
sergeyt / pullall.cmd
Last active March 21, 2016 12:35
cmd script to pull and update all repositories in current folder
set root=%~dp0
for /f %%i in ('dir . /b /ad') do (
cd %root%%%i
if exist ".git" (
git pull
)
if exist ".hg" (
hg pull -u
)
)
@sergeyt
sergeyt / onchange.sh
Created December 29, 2013 14:53 — forked from senko/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <[email protected]>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@sergeyt
sergeyt / meteor-handlebars-helpers.coffee
Created January 16, 2014 17:12
Meteor handlebars template helpers
# Handlebars helpers
return if (typeof Handlebars == 'undefined')
Handlebars.registerHelper "timeago", (date) ->
return 'some time ago' if not date
dateObj = new Date(date)
return moment(dateObj).fromNow().replace(/\ /g, '\u00a0')
Handlebars.registerHelper "gravatar", (email, size) ->
Gravatar.imageUrl(email, {s: size})
// Using bin/typescript.js from TypeScript 0.9.7
function compile(source) {
var parseErrors = [];
var logger = new TypeScript.NullLogger();
var compilationSettings = TypeScript.ImmutableCompilationSettings.defaultSettings();
var compiler = new TypeScript.TypeScriptCompiler(logger, compilationSettings);
var snapshot = TypeScript.ScriptSnapshot.fromString(source);
# Add this line to your software sources
deb http://debian.meebey.net/experimental/mono /
sudo apt-get update
# of course, apt-get remove mono-complete first...
sudo apt-get install mono-complete
# I installed monodevelop from apt just to get all the prereqs
sudo apt-get install monodevelop
@sergeyt
sergeyt / meteor-typeahead-prefetch.html
Created September 29, 2014 14:24
Prefetch example
<template name="prefetch">
<div>
<h2>Prefetch</h2>
<div class="form-group">
<input class="form-control typeahead" name="country" type="text" placeholder="Country"
autocomplete="off" spellcheck="off" data-source="/data/countries.json"/>
</div>
</div>
</template>
@sergeyt
sergeyt / mini-asp-router.cs
Created October 3, 2014 03:06
Mini asp.net router
private sealed class Router
{
private readonly HttpContext _context;
private bool? _lastOp;
private bool _cumulativeResult;
public Router(HttpContext context)
{
if (context == null) throw new ArgumentNullException("context");
@sergeyt
sergeyt / gogs-deps.sh
Last active August 29, 2015 14:07
gogs get deps
# install tools
sudo apt-get install git python-software-properties pkg-config
sudo apt-get install gcc libc6-dev
sudo apt-get install mercurial
# install golang from source
hg clone -u release https://code.google.com/p/go
cd go/src
./all.bash