Skip to content

Instantly share code, notes, and snippets.

@sagarpanda
sagarpanda / git common commands
Last active November 8, 2019 04:01
git common commands
git clone git@example.com
git remote add origin git@example.com
git pull
git remote -v
git push origin master
# create patch file for last 3 commits
@sagarpanda
sagarpanda / define
Created November 8, 2013 14:54
define a class
var defineModule = (function(name, func){
window.App = App || {};
App.modules = App.modules || {};
if (!App.modules[name]) {
App.modules[name] = func;
}else{
console.log(name+" module exist.");
};
});
@sagarpanda
sagarpanda / animation.as
Created November 13, 2013 06:26
gotoAndPlay/gotoAndStop in swiffy
import flash.events.Event;
this.addEventListener(Event.ENTER_FRAME, _oef );
var f:Number = 0;
function _oef(e:Event):void {
if(this.loaderInfo.parameters.call)
{
f = Number(this.loaderInfo.parameters.fm);
@sagarpanda
sagarpanda / api.js
Created January 22, 2014 18:07
jsonp Example
getRoute({"fname":"Sagar", "lname":"Panda"});
Design Pattern:- It's a re-usable solution to common types of problem.
1. Creational Pattern
Factory, Builder, Prototype, Singleton
2. Structural pattern
Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
3. Behavioral Pattern
Command, Iterator, Mediator, Observer, Strategy
documentation
http://wiki.swftools.org/wiki/Main_Page
swfc
example: http://wiki.swftools.org/wiki/Swfc_Code_Snippets
ref: http://www.herongyang.com/Flash/SWFC-Script-Example-circle.html
as3compile
ref: http://www.herongyang.com/Flash/AS3Compile-First-ActionScript-3-Example.html
@sagarpanda
sagarpanda / Pseudo Streming
Created February 14, 2014 09:54
pseudo streaming video
http://1stdev.com/tremendum-transcoder/articles/seeking-videos-beyond-the-buffer-line/
http://h264.code-shop.com/trac/wiki
@sagarpanda
sagarpanda / nvm
Last active August 29, 2015 13:58
nvm setup
#Required Packages:
$ sudo apt-get install git
$ sudo apt-get install curl
#Then run below to install nvm
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
#need nvm to be automatically sourced upon login, so either add the following line to your
#~/.bashrc or ~/.profile file.
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
@sagarpanda
sagarpanda / allows cross-domain communication from the browser
Last active August 29, 2015 13:58
allows cross-domain communication from the browser
Front End
---------
var formData = new FormData();
formData.append("name", "Groucho");
var xhr = new XMLHttpRequest();
//xhr = new XDomainRequest();// for IE
xhr.open("POST", "http://115.99.16.3/html/demo/data_json.php");
xhr.send(formData);
xhr.onload = function(){console.log(xhr.response)}
@sagarpanda
sagarpanda / publishIP.sh
Last active August 29, 2015 13:59
Publish extrnal ip on ubuntu startup
#!/bin/sh
PublishMyIP(){
extIp="$(curl ifconfig.me)" #get external ip
curl http://localhost/setmyip.php?ip=$extIp
echo "$extIp"
}
sleep 30s
PublishMyIP
sleep 1m
PublishMyIP