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
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);
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'
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 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: [],
@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';
@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")