Skip to content

Instantly share code, notes, and snippets.

View junaidk's full-sized avatar

Junaid Khalid junaidk

  • Mirantis
  • Berlin
View GitHub Profile

creat a text file with name .nanorc and add following lines in it

include "/usr/share/nano/java.nanorc"
include "/usr/share/nano/c.nanorc"

copy the java.nanorc & c.nanorc files using following commands
cp /usr/share/nano/java.nanorc .
cp /usr/share/nano/c.nanorc .
@junaidk
junaidk / android_icon_generator.py
Last active August 29, 2015 13:57
create all sizes of icon for android application from a given image
# Uses PIL library for resizing
# http://www.pythonware.com/products/pil/
# resize.py arg1 arg2
# arg1 : src image name
# arg2 : dir path of src image
import os
import getopt
import sys
@junaidk
junaidk / androidmk.java
Created March 18, 2014 16:21
automatically creates android.mk file for cocos2dx project with all `classes` in classes dir. Run it in proj.android/jni director. Tested for cocos2dx versions 2.x.x
import java.io.File;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
public class androidmk {
void MainMenu::setUpMainMenu(){
CCArray * spriteArray = CCArray::createWithCapacity(3);
CCArray * array = CCArray::createWithCapacity(3);

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@junaidk
junaidk / LineBreak.py
Last active August 29, 2015 14:04
Plugin to remove line breaks and create a single line
import sublime, sublime_plugin
class LineCommand(sublime_plugin.TextCommand):
def run(self, edit):
s = self.view.sel()
for region in s:
if not region.empty():
selection = self.view.substr(region)
selection_mod = selection.replace('\n', ' ').replace('\r', '')

cocos2d-x

Build Status Build Status

[cocos2d-x][1] is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications.

@junaidk
junaidk / downloader.py
Last active August 29, 2015 14:05
WallBase Scrapping
import urllib2
fs = open("../satish.txt","r")
for line in fs:
wfile = urllib2.urlopen(line)
fileName = line.split("/")[4]
fileName = fileName.replace("\n","")
output = open("images/"+fileName,'wb')
output.write(wfile.read())
output.close()
@junaidk
junaidk / 10books.md
Last active August 29, 2015 14:05
10 Books Challange

Wasay

  1. The Alchemist (inspirational and all)
  2. The kite runner (I don't know, I liked it)
  3. The catcher in the Rye (Best book ever. Period.)
  4. 1493 (History but good)
  5. A case of exploding mangoes (Well, I needed a Pakistani book in the list)
  6. Neither Here nor There (Best travel book ever)
  7. By River Piedra I Sat and Wept (Emotional as hell)
  8. The outliers (A feel good book for crappy days)
  9. About the Author (A fun read)
@junaidk
junaidk / ReadMe
Last active August 29, 2015 14:07
Maven Scala pom + Eclipse
In eclipse create configuration for project. With Main class name.