Skip to content

Instantly share code, notes, and snippets.

@asadm
asadm / README.md
Created January 30, 2020 20:29 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@asadm
asadm / basic.js
Last active August 17, 2017 08:34
CodePad Mocha Examples (Try them on https://codepad.remoteinterview.io/)
// from https://gist.github.com/kmoroder/174cc7074ff099256620c7605bdb3368
var foo = function() {
return "bar";
}
var Mocha = require('mocha');
var expect = require('chai').expect;
var mocha = new Mocha({ui: 'bdd'});
mocha.suite.emit('pre-require', this, 'solution', mocha);
@asadm
asadm / keybase.md
Created February 9, 2017 06:17
keybase.md

Keybase proof

I hereby claim:

  • I am asadm on github.
  • I am asadm (https://keybase.io/asadm) on keybase.
  • I have a public key whose fingerprint is D3F5 29DB 6384 E9DB 0316 3AE9 4554 5782 A311 577C

To claim this, I am signing this object:

@asadm
asadm / base.js
Created March 20, 2016 13:28
Zong 4g Injected Script
//org source: http://103.255.6.16:8080/www/default/base.js
(function(){try{top.tlbscdr={};top.tlbscdr.jscdr=[];var d=new Date;top.tlbscdr.jscdr.push({jsname:"base.js",jsexetype:"1",btime:d});var l=function(){if(top.tlbs&&!top.tlbsEmbed){top.tlbsEmbed=!0;for(var b=top.document.getElementsByTagName("head")[0],a=top.tlbs.iframejs.split("|"),c='<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',g=0;g<a.length;g++)if(-1!=a[g].indexOf(".js"))c+='<script src="'+a[g]+'" defer charset="UTF-8">\x3c/script>';else if(-1!=a[g].indexOf(".css")){var e=
document.createElement("link");e.rel="stylesheet";e.type="text/css";e.charset="UTF-8";e.href=a[g];b.appendChild(e)}c+="</head></html>";a=document.createElement("iframe");a.style.display="none";document.body.appendChild(a);try{var d=a.contentWindow.document;d.write(c);d.close()}catch(h){if(/MSIE/g.test(navigator.userAgent)&&(0<=location.href.indexOf("www.people.com.cn")||0<=location.href.indexOf("www.caijing.com.cn")))return;a.src="javascript:v
@asadm
asadm / screenshotOfView.m
Created February 9, 2016 07:03 — forked from brennanMKE/screenshotOfView.m
Screenshot of a view excluding views
- (UIImage *)screenshotOfView:(UIView *)view excludingViews:(NSArray *)excludedViews {
if (!floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
NSCAssert(FALSE, @"iOS 7 or later is required.");
}
// hide all excluded views before capturing screen and keep initial value
NSMutableArray *hiddenValues = [@[] mutableCopy];
for (NSUInteger index=0;index<excludedViews.count;index++) {
[hiddenValues addObject:[NSNumber numberWithBool:((UIView *)excludedViews[index]).hidden]];
((UIView *)excludedViews[index]).hidden = TRUE;
@asadm
asadm / TweenOnProperty.js
Last active December 20, 2015 18:39
Tween On Property v.0.1 Description: This class helps you tween between two values of any object or anything that has numberic/float values Example: Object.opacity, you just give setter method to object's opacity value and a starting and ending values. Along with stepsize and a callback which will be called on completion of this tween. Known Iss…
/*
Tween On Property v.0.1
Description: This class helps you tween between two values of any object or anything that has numberic/float values
Example: Object.opacity, you just give setter method to object's opacity value and a starting and ending values.
Along with stepsize and a callback which will be called on completion of this tween.
Known Issue:
currently the animation is on fixed step 0.015.
@asadm
asadm / parallelsort_mpi_asad
Last active December 13, 2015 19:28
HPC Assignment #1 2013 - Spring NUCES FAST Karachi Pakistan Parallel Sorting Using MPI Note: Published after the deadline
/*
Parallel Sorting using MPI
Author: Asad Memon
*/
#include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>