Skip to content

Instantly share code, notes, and snippets.

View mehmetkose's full-sized avatar
:electron:
Reacting

Mehmet Kose mehmetkose

:electron:
Reacting
  • Sour Cream LTD
  • Dublin, Ireland
  • 02:28 (UTC +01:00)
  • X @mehmetkose
View GitHub Profile
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb
sudo dpkg -i elasticsearch-0.90.7.deb

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Install Ionic to dev android app on ubuntu 14.04
0. Instal ubuntu-14.04-desktop-amd64.iso
sudo apt-get update
sudo apt-get install exfat-fuse exfat-utils
sudo reboot
1. Copy jdk-7u60-linux-x64.tar.gz, apache-ant-1.9.4-bin.tar.gz to /opt and copy adt-bundle-linux-x86_64-20140321.zip to HOME/android
cd /opt
sudo tar zxvf jdk-7u60-linux-x64.tar.gz
@mehmetkose
mehmetkose / s3.py
Last active August 29, 2015 14:18 — forked from taylanpince/s3.py
import hashlib, hmac, mimetypes, os, time
from base64 import b64encode, b64decode
from calendar import timegm
from datetime import datetime
from email.utils import formatdate
from urllib import quote
from tornado.gen import coroutine, Return
from tornado.httpclient import AsyncHTTPClient, HTTPError
@mehmetkose
mehmetkose / futures_test.py
Last active September 12, 2015 14:34 — forked from lbolla/futures_test.py
Tornado and concurrent.futures
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
@mehmetkose
mehmetkose / tornado_asyncio.py
Created October 22, 2015 06:57 — forked from drgarcia1986/tornado_asyncio.py
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@mehmetkose
mehmetkose / main.py
Created October 24, 2015 19:15 — forked from jackyyf/main.py
Gist by paste.py @ 2015-07-04 09:11:16.505897
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.web import RequestHandler, Application, url
from tornado.httpserver import HTTPServer
from tornado.httpclient import AsyncHTTPClient, HTTPError
from tornado.gen import coroutine, Return, WaitIterator
from tornado.netutil import bind_sockets, bind_unix_socket
from tornado.process import fork_processes
@mehmetkose
mehmetkose / setup_howto.txt
Created December 18, 2015 09:33 — forked from kosiara/setup_howto.txt
Setup Facebook React-native sample (empty) project on Ubuntu
# author:
# @Bartosz Kosarzycki
#
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
@mehmetkose
mehmetkose / tornado_websocket_ee.py
Created November 29, 2016 09:27 — forked from gnpkrish/tornado_websocket_ee.py
Realtime Communicating with front-end using simple EventEmitter. With use of Tornado + Websocket.
"""
This is a simple example of WebSocket + Tornado + Simple EventEmitters usage.
Thanks to pyee by https://github.com/jesusabdullah
@Author:: Narayanaperumal G <gnperumal@gmail.com>
"""
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
from collections import defaultdict
@mehmetkose
mehmetkose / ws_app.py
Created November 30, 2016 16:27 — forked from kracekumar/ws_app.py
Simple websocket server with uvloop.
# -*- coding: utf-8 -*-
import asyncio
import uvloop
from aiohttp.web import Application, MsgType, WebSocketResponse
def add_socket(app, socket, user_id):
if user_id in app['connections']:
pass