Skip to content

Instantly share code, notes, and snippets.

View roshanpal's full-sized avatar
🎯
Focusing

Roshan Pal roshanpal

🎯
Focusing
View GitHub Profile
@roshanpal
roshanpal / ddos.js
Created August 31, 2017 17:29
Node.js stress testing script
var request = require('request');
// Set the headers
var headers = {
'User-Agent': 'Super Agent/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded',
'Referer': ''
}
// Configure the request
# Built application files
build/
bin/
gen/
.idea
.settings
# Crashlytics configuations
com_crashlytics_export_strings.xml
JsonArrayRequest request = new JsonArrayRequest(url, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
for (int i = 0; i < response.length(); i++) {
try {
JSONObject jp = response.getJSONObject(i);
Post p = new Post(
jp.getInt("userId"),
jp.getInt("id"),
jp.getString("title"),
private class MyListAdapter extends ArrayAdapter<Newspaper> {
public MyListAdapter() {
super(MainActivity.this, R.layout.item_view, newsPapers);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View itemView = convertView;
if(convertView == null) {
private class UploadTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... params) {
HashMap<String, String> postData = new HashMap<>();
postData.put("image", params[0]);
String t = performPostCall("http://examxple.com/upload.php", postData);
Log.d("TUNA", t);
return null;
}
@roshanpal
roshanpal / gist:37acd854a889f7b73a1c
Created July 16, 2015 04:33
PHP AES Encryption/Decryption Class with PKCS5 padding
<?php
/**
* Created by PhpStorm.
* User: roshan
* Date: 4/5/15
* Time: 2:46 PM
*/
class Aes
{"Afghanistan":"Afghanistan","Albania":"Albania","Algeria":"Algeria","American Samoa":"American Samoa","AndorrA":"AndorrA","Angola":"Angola","Anguilla":"Anguilla","Antarctica":"Antarctica","Antigua and Barbuda":"Antigua and Barbuda","Argentina":"Argentina","Armenia":"Armenia","Aruba":"Aruba","Australia":"Australia","Austria":"Austria","Azerbaijan":"Azerbaijan","Bahamas":"Bahamas","Bahrain":"Bahrain","Bangladesh":"Bangladesh","Barbados":"Barbados","Belarus":"Belarus","Belgium":"Belgium","Belize":"Belize","Benin":"Benin","Bermuda":"Bermuda","Bhutan":"Bhutan","Bolivia":"Bolivia","Bosnia and Herzegovina":"Bosnia and Herzegovina","Botswana":"Botswana","Bouvet Island":"Bouvet Island","Brazil":"Brazil","British Indian Ocean Territory":"British Indian Ocean Territory","Brunei Darussalam":"Brunei Darussalam","Bulgaria":"Bulgaria","Burkina Faso":"Burkina Faso","Burundi":"Burundi","Cambodia":"Cambodia","Cameroon":"Cameroon","Canada":"Canada","Cape Verde":"Cape Verde","Cayman Islands":"Cayman Islands","Central African Re
[{"Afghanistan":"Afghanistan"},{"Albania":"Albania"},{"Algeria":"Algeria"},{"American Samoa":"American Samoa"},{"AndorrA":"AndorrA"},{"Angola":"Angola"},{"Anguilla":"Anguilla"},{"Antarctica":"Antarctica"},{"Antigua and Barbuda":"Antigua and Barbuda"},{"Argentina":"Argentina"},{"Armenia":"Armenia"},{"Aruba":"Aruba"},{"Australia":"Australia"},{"Austria":"Austria"},{"Azerbaijan":"Azerbaijan"},{"Bahamas":"Bahamas"},{"Bahrain":"Bahrain"},{"Bangladesh":"Bangladesh"},{"Barbados":"Barbados"},{"Belarus":"Belarus"},{"Belgium":"Belgium"},{"Belize":"Belize"},{"Benin":"Benin"},{"Bermuda":"Bermuda"},{"Bhutan":"Bhutan"},{"Bolivia":"Bolivia"},{"Bosnia and Herzegovina":"Bosnia and Herzegovina"},{"Botswana":"Botswana"},{"Bouvet Island":"Bouvet Island"},{"Brazil":"Brazil"},{"British Indian Ocean Territory":"British Indian Ocean Territory"},{"Brunei Darussalam":"Brunei Darussalam"},{"Bulgaria":"Bulgaria"},{"Burkina Faso":"Burkina Faso"},{"Burundi":"Burundi"},{"Cambodia":"Cambodia"},{"Cameroon":"Cameroon"},{"Canada":"Canada"},{"C
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},