Skip to content

Instantly share code, notes, and snippets.

View killmenot's full-sized avatar

Alexey Kucherenko killmenot

  • Taganrog, Russian Federation
  • 16:49 (UTC +03:00)
View GitHub Profile
@killmenot
killmenot / index.js
Last active December 14, 2015 14:08
JS Test task
function G(C){
function A(){
var C = new C();
C;
}
A();
}
function B(){};
G(B);
/**
* Author: Michael Weibel <michael.weibel@gmail.com>
* License: MIT
*/
var passport = require('passport')
, StrategyMock = require('./strategy-mock');
module.exports = function(app, options) {
// create your verify function on your own -- should do similar things as
/*
* Little example of how to use ```socket-io.client``` and ```request``` from node.js
* to authenticate thru http, and send the cookies during the socket.io handshake.
*/
var io = require('socket.io-client');
var request = require('request');
/*
* This is the jar (like a cookie container) we will use always
@killmenot
killmenot / cache_provider.php
Created April 30, 2014 19:55
Cache provider architecture
<?php
interface ICacheProvider
{
public function get($charecter_id);
class DbCacheProvider implements ICacheProvider
{
function __construct($db)
@killmenot
killmenot / download_resource.acceptance.js
Created June 17, 2014 09:55
Sample of acceptance test
var assert = require('assert'),
support = require('../../support'),
request = require('request');
describe("Feature: Download resources", function () {
var http_client,
server_url = 'http://127.0.0.1:8080',
auth = {
username: '1',
password: 'alexey@intspirit.com'
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
# Download & install marports http://www.macports.org/install.php
$ sudo port selfupdate
$ sudo port install nginx
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
$ sudo port install php5 +fastcgi fcgi
$ sudo mkdir /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ cd /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ mate org.macports.php-fastcgi.plist # or vim org.macports.php-fastcgi.plist
@killmenot
killmenot / project.sublime-project
Created November 25, 2014 20:56
Sublime Text project's file
{
"folders":
[
{
"follow_symlinks": true,
"path": ".",
"folder_exclude_patterns": ["node_modules", ".sass-cache"],
"file_exclude_patterns": ["*.lock"]
}
],
@killmenot
killmenot / sample.conf
Created December 4, 2014 12:51
Nginx+node sample config
server {
listen 443;
server_name <host>;
ssl on;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/cert.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers C4:HIGH:!aNULL:!MD5;
@killmenot
killmenot / .bash_profile
Created December 11, 2014 21:02
PostgreSQL command line aliases
# PostgreSQL
export PATH="/Library/PostgreSQL/9.3/bin:$PATH"
alias postgres.start="sudo su postgres -c '/Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data start'"
alias postgres.stop="sudo su postgres -c '/Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data stop -s -m fast'"