Skip to content

Instantly share code, notes, and snippets.

View iofjuupasli's full-sized avatar

Valery iofjuupasli

  • fugo.ai
  • Warsaw, Poland
  • 11:36 (UTC +02:00)
View GitHub Profile
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@iofjuupasli
iofjuupasli / manyToManyMap.js
Last active August 29, 2015 13:57
Mapping array of many-to-many entities to map with faster access
function manyToManyMap(source, first, second) {
'use strict';
var result = {}, i, item;
for (i = 0; i < source.length; i += 1) {
item = source[i];
if (!result[item[first]]) {
result[item[first]] = {};
}
result[item[first]][item[second]] = item;
}
@miklschmidt
miklschmidt / server.coffee
Created July 1, 2013 18:42
Scripts for making autoupdates in node-webkit for Linux and Windows. This is a very early work in progress, more like a proof of concept. TODO: Add OS X support. Check for and notify about filelocks. Use a real db. Abstract out update logic into strategies (node-webkit, assets, updater). Use semver for version handling. Changelogs in Markdown. P…
fs = require('fs')
http = require('http')
https = require('https')
express = require('express')
path = require 'path'
_ = require('underscore')
sessionToken = "secretString"
secretUploadPass = "Change me"
secretPass = "Change me too"
@evanlarsen
evanlarsen / transitionHelper.js
Last active February 8, 2021 17:12
Durandal transition helper file. This imposes that you are using https://github.com/daneden/animate.css Also, that you have changed the animation duration in animate.css from 1s to .3s
define(function(require) {
var system = require('../system');
var animationTypes = [
'bounce',
'bounceIn',
'bounceInDown',
'bounceInLeft',
'bounceInRight',
'bounceInUp',
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh