Skip to content

Instantly share code, notes, and snippets.

View BatuhanK's full-sized avatar
👀
o rly?

Batuhan KATIRCI BatuhanK

👀
o rly?
View GitHub Profile
@jpoehls
jpoehls / node-cluster-messaging.js
Created March 29, 2012 01:48
Simple message passing between cluster master and workers in Node.js
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active December 26, 2022 19:30
Nginx + secure pseudo-streaming
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz
@ekrembk
ekrembk / sehir_tespiti.js
Created November 6, 2012 10:14
Kullanıcının şehrini Javascript ile otomatik tespit etme. HTML5 Geocoding API ve Reverse Geocoding için Yandex Geocoder kullanıldı.
function otomatikBul() {
// Browser desteğini kontrol et
if( ! navigator.geolocation ) {
console.log( 'Broserınız desteklemiyor. Lütfen manual seçim yapınız.' );
return;
}
// Uyarı
console.log( 'Koordinatlar alınıyor...' );
@xingrz
xingrz / app.js
Created January 23, 2013 15:35
Seems to be a "best practice" of developing with [mongoose](http://mongoosejs.com).
var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/mydb', function () {
console.log('mongodb connected')
})
/** @jsx React.DOM */
var MyComponent = React.createClass({
render: function() {
// Defaults in case the props are undefined. We'll have a solution for this
// soon that is less awkward.
var perMinute = this.props.perMinute || '-';
var perDay = this.props.perDay || '-';
return (
<div>
<h3>Clickouts</h3>
/** @jsx React.DOM */
var MyComponent = React.createClass({
getInitialState: function() {
// set up the initial state. used for "logical" initialization code
return {perMinute: '-', perDay: '-'};
},
componentDidMount: function() {
// fired only once, when the component is added to the DOM
// used for initialization code that has "side effects" i.e. i/o, jquery plugins, etc
var socket = io.connect(this.props.url);
@nnarhinen
nnarhinen / express-server-generator.js
Last active February 28, 2016 17:48
Example files on how to use ES6 generators in your code to reduce callback nesting
'use strict';
/*
* Express server using ES6 generators
* Use node 0.11
* run with node --harmony express-server-generator.js
*/
var Q = require('q'),
HTTP = require('q-io/http'),
express = require('express'),
http = require('http');
@jeremypetrequin
jeremypetrequin / article.md
Last active December 25, 2016 08:06
How to convert a Flash/After Effects animation into a JSMovieclip animation

How to convert a Flash/After Effects animation into a JSMovieclip animation

Intro

JSMovieclip is a little javascript framework. It allows you to play, control... animations like a Movieclip object in AS3. It uses a sprite which contains all frames of the animation.

Purpose : We'll create a sprite to use with JSMovieclip, from a Flash animation, using TexturePacker

Requirement : We'll use Flash/After Effects, Texture Packer, and JSMovieclip script

@marcojetson
marcojetson / service-status.js
Last active August 29, 2015 13:56
Detect if visitor is logged into Google, Google Plus, Taringa! or Twitter
// check<Service>Status([ onSuccess, onFailure ]);
// i.e checkTaringaStatus(function () { alert('+10'); });
(function () {
var checkServiceStatus = function (image, success, error) {
return function (success, error) {
var img = new Image();
img.onload = success || function () {};
img.onerror = error || function () {};
img.src = image;
};
@wbroek
wbroek / genymotionwithplay.txt
Last active November 8, 2024 01:24
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)