Skip to content

Instantly share code, notes, and snippets.

View cyphunk's full-sized avatar

Nathan Fain cyphunk

  • stage theatre + reverse engineering
View GitHub Profile
@cyphunk
cyphunk / bot_example.py
Created April 11, 2019 18:18 — forked from Vexs/bot_example.py
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@cyphunk
cyphunk / Makefile
Created September 3, 2018 11:13 — forked from f0rki/Makefile
Can you LD_PRELOAD from noexec mounted directory?
all: test preload.so
clean:
-$(RM) test preload.so
%.so: %.c
$(CC) $^ -o $@ -shared -fPIC $(CFLAGS)
@cyphunk
cyphunk / softmax.js
Last active April 6, 2024 11:21 — forked from vladimir-ivanov/softmax.js
softmax function implementation in js
// Fork & examples for the one-line version by @vladimir-ivanov:
//let softmax = (arr) => (index) => Math.exp(arr[index]) / arr.map(y => Math.exp(y)).reduce((a, b) => a + b);
//
// Also see comments for improvements
function softmax(arr) {
return arr.map(function(value,index) {
return Math.exp(value) / arr.map( function(y /*value*/){ return Math.exp(y) } ).reduce( function(a,b){ return a+b })
})
}
@cyphunk
cyphunk / phantomjs-facebook-update.js
Created December 16, 2016 16:32 — forked from ariefbayu/phantomjs-facebook-update.js
facebook status update using phantomjs
var page = new WebPage();
//spoof it as opera mini, to get the mobile page working properly
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10";
function doLogin(){
page.evaluate(function(){
var frm = document.getElementById("login_form");
frm.elements["email"].value = "--enter-your-email--";