Skip to content

Instantly share code, notes, and snippets.

View voronianski's full-sized avatar

Dmytro Voronianski voronianski

View GitHub Profile
@voronianski
voronianski / package.json
Created October 11, 2012 13:09
package json for yawnt
{
"name": "geotest",
"subdomain": "geotest",
"author": "Dmitri Voronianski <dmitri.voronianski@gmail.com>",
"scripts": {
"start": "server.js"
},
"version": "0.0.2-3",
"engines": {
"node": "0.8.x"
@voronianski
voronianski / typewriter.js
Last active December 10, 2015 04:18
typewriter effect text with jquery
function typewriter(text, n) {
if (n < (text.length)) {
aboutBlock.html(text.substring(0, n+1));
n++;
setTimeout(function() {
myprint(text, n)
}, 100);
}
}
@voronianski
voronianski / CORS_test.html
Last active December 10, 2015 13:59 — forked from bennadel/demo.htm
<!DOCTYPE html>
<html>
<head>
<title>Cross-Origin Resource Sharing (CORS) test</title>
</head>
<body>
<body>
<h2>Test CORS localhost</h2>
<a href="#" class="put">PUT</a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@voronianski
voronianski / http.js
Created February 18, 2013 20:13 — forked from bsstoner/http.js
/**
* Modified version of TJ's http support file from the Express repo:
* https://github.com/visionmedia/express/blob/master/test/support/http.js
*
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter
, should = require('should')
, methods = ['get','post','put','delete','head']
/*
Put on top of the file before describe statements
Usage:
expect(fn).toBeFunction()
*/
beforeEach(function (){
this.addMatchers({
toBeFunction: function (){
return Object.prototype.toString.call(this.actual)==='[object Function]';
}
@voronianski
voronianski / getprinted.js
Last active December 14, 2015 12:49
getprinted.js - custom print method that supports crossbrowser callbacks on after & before print() is fired
/**
* Custom print method plugin
* @param options {Object} - custom callbacks before print inited and after (onBeforePrint, onAfterPrint);
*
* (c) 2012 http://pixelhunter.me MIT Licensed
*/
(function() {
var originalPrint = this.print;
@voronianski
voronianski / Makefile
Last active December 14, 2015 18:29
Makefile ubuntu / elementary os
chrome-install:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
sublime-install:
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@voronianski
voronianski / config
Created March 30, 2013 13:53
put this into ~/.ssh/config (create if no such file)
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443