Skip to content

Instantly share code, notes, and snippets.

View nxsyed's full-sized avatar
👁️‍🗨️
Cory is officially in the house

Syed Ahmed nxsyed

👁️‍🗨️
Cory is officially in the house
View GitHub Profile
@nxsyed
nxsyed / testpass.py
Created November 11, 2017 18:29
Test password function which compares the encrypted password to the dictionary.
def test_pass(encrypted_pass, filename):
salt = encrypted_pass[0:2]
dict_list = open(filename,'r').split('\n')
for word in dict_list:
crypt_word = c.crypt(word, salt)
if (crypt_word == encrypted_pass):
print("[$] Found Password: "+word+"\n")
return
print("[-] Password Not Found.\n")
@nxsyed
nxsyed / IBM Assistant Function.js
Last active June 8, 2018 19:26
Assistant function made for pubnub functions
export default (request, response) => {
const base64Codec = require('codec/base64');
const query = require('codec/query_string');
const console = require('console');
const xhr = require('xhr');
const pubnub = require('pubnub');
const vault = require('vault');
const senderName = 'PubNub Bot';
const version = '2018-02-16';
import React from 'react';
class Chat extends React.Component{
// return the initial state of our Chat class
constructor() {
super();
this.chat = new ChatClient.Chat(`${now}chat`);
this.state = {
messages: [],
import { Button, Input, List } from 'antd';
// Other Code
render() {
const messages = [
'Ok I\'ll be there in 5 mins',
'Call my number 415-xxx-6631',
'Alright, the door is open'
];
return (
<div className="App">
import React, { Component } from 'react';
import PubNubReact from 'pubnub-react';
import { Button, Input, List } from 'antd';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.pubnub = new PubNubReact({
publishKey: 'Your Pub Key',
subscribeKey: 'Your Sub Key'
let headersObject = request.headers;
let paramsObject = request.params;
let methodString = request.method;
let bodyString = request.body;
// Set the status code - by default it would return 200
response.status = 200;
// Set the headers the way you like
response.headers['X-Custom-Header'] = 'CustomHeaderValue';
console.log(paramsObject);
export default (request) => {
const kvstore = require('kvstore');
const xhr = require('xhr');
const pubnub = require('pubnub');
const {location, id} = JSON.parse(request.message);
var people = [];
kvstore.set(id, {lat: location.lat, long: location.long});
kvstore.getKeys().then((keys) => {
for(var i=0; i<keys.length;i++){
@nxsyed
nxsyed / CalculateDistance.js
Created February 19, 2019 19:04
Calculating Distance
export default (request) => {
const kvstore = require('kvstore');
const xhr = require('xhr');
const pubnub = require('pubnub');
const message = JSON.parse(request.message);
console.log(message);
kvstore.getItem(message[1]).then((value) => {
var location = JSON.parse(value);
var distanceDelta = distance(message[2], message[3], location.lat, location.long, "K");
pubnub.publish({
dependencies {
implementation group: 'com.pubnub', name: 'pubnub-gson', version: '4.20.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"