Skip to content

Instantly share code, notes, and snippets.

@esfand
esfand / install.py
Created May 28, 2018 22:04 — forked from ajumell/install.py
Webfaction Magento Insatll script.
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/bin/env python2.4
"""
Magento 1.7.0.2
"autostart": not applicable
"extra info": Do you agree to Magento's license?
http://www.opensource.org/licenses/osl-3.0.php
@esfand
esfand / RIOServer_sm9.cpp
Created February 26, 2018 20:07 — forked from ujentus/RIOServer_sm9.cpp
Windows Registered I/O (RIO) Sample Code (Echo Server)
/*********************************************************************************************************
* Windows Registered I/O (RIO) Sample Code (Echo Server)
* Minimum requirement: Windows 8 or Windows Server 2012
* Author: @sm9kr
*
* Notice
* 몇몇 코드 조각들은 (http://www.serverframework.com/asynchronousevents/rio/)에서 가져옴.
* 그런데 여기도 제대로 완성된 코드가 있었던 것은 아니라서 상당 부분 기능을 추가하여 동작하도록 함.
* RIO의 사용법을 보여주기 위한 코드라 최대한 간단하게 필요한 부분만 넣었음.
* 그래서, 버그가 있을 수 있음...
@esfand
esfand / TwitterStream.cpp
Created January 26, 2018 21:54 — forked from komasaru/TwitterStream.cpp
C++ source code to get twitter timelines by Twitter Streaming API.
/*
* Getting timelines by Twitter Streaming API
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <oauth.h>
#include <curl/curl.h>
@esfand
esfand / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Created December 17, 2017 15:55 — forked from jakebellacera/nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
# useful nginx configuration for reverse proxy with Apache
# edit lines 8, 11, and 30
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com)
server {
listen 80;
server_name domain.com *.domain.com; # edit this to your domain
@esfand
esfand / OAuth1.java
Created October 31, 2017 17:24 — forked from khris/OAuth1.java
Alternative OAuth 1 implements for Twitter's hbc. It's compatible with joauth 6.0.+ so independent from Scala.
/**
* Original: https://github.com/twitter/hbc/blob/master/hbc-core/src/main/java/com/twitter/hbc/httpclient/auth/OAuth1.java
*
* It is compatible with scala-less joauth 6.0.+, but hbc is not
* compatible with Android. #EpicFail
*
* Licensed under the Apache License, Version 2.0 (the "License");
**/
/**
@esfand
esfand / background.js
Created October 16, 2017 09:36 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@esfand
esfand / stream.py
Created June 25, 2017 18:37 — forked from messa/stream.py
Twitter Streaming API example
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import oauth2 # https://raw.github.com/brosner/python-oauth2/master/oauth2/__init__.py
from pprint import pprint
import urllib2
stream_url = "https://stream.twitter.com/1/statuses/filter.json"
export class Hero {
private _id: number;
private _name: string;
private _power: string
private _alterEgo: string
constructor(
public id: number,
public name: string,
public power: string,

Typings for npm packages

https://github.com/Microsoft/TypeScript.wiki.git

TypeScript 1.6 has introduced new way of resolving module names that mimics the Node.js module resolution algorithm. This means the TypeScript compiler can currently load typings that are bundled with npm packages.

The compiler will try to discover typings for module "foo" using the following set of rules:

@esfand
esfand / even.js
Created November 19, 2015 12:16 — forked from fson/even.js
Mutually recursive modules
import odd from './odd';
export default function even(n) {
if (n === 0) {
return true;
}
return !odd(n - 1);
}