Skip to content

Instantly share code, notes, and snippets.

View junaidk's full-sized avatar

Junaid Khalid junaidk

  • Mirantis
  • Berlin
View GitHub Profile
@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);
@junaidk
junaidk / resources.md
Last active January 4, 2023 10:25
Google App Script Resources

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 / settings_default.json
Created August 14, 2014 15:14
Sublime Alignment Plugin Settings file
{
// If the indent level of a multi-line selection should be aligned
"align_indent": true,
// If indentation is done via tabs, set this to true to also align
// mid-line characters via tabs. This may cause alignment issues when
// viewing the file in an editor with different tab width settings. This
// will also cause multi-character operators to be left-aligned to the
// first character in the operator instead of the character from the
// "alignment_chars" setting.
@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)