Skip to content

Instantly share code, notes, and snippets.

Andrea Brancaleoni thypon

Block or report user

Report or block thypon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kristopolous
kristopolous / hn_seach.js
Last active Sep 12, 2019
hn job query search
View hn_seach.js
function query() {
var
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments),
shown = 0, total = job_list.length;
// Traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.classList.contains(klass)) {
@nstarke
nstarke / nodejs-security-vulnerability-grep.sh
Last active Aug 22, 2019
Node.js Security Vulnerability Grep
View nodejs-security-vulnerability-grep.sh
# this command will return instances where the child_process module is loaded.
# that module is generally a good signal that the application is shelling out
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "require(\s*)\((\s*)'child_process'(\s*))" .
# this command will return instances where code is dynamically executed.
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "eval(\s*)\(" .
# this command will check common dangerous functions and report when strings are arguments
egrep -r --exclude-dir "node_modules" --include "*.js" --exclude "*.min.*" -e "(setInterval|setTimeout|new(\s*)Function)(\s*)\((\s*)\".*\"" .
View build_module.sh
cd $ANDROID_BUILD_TOP/packages/apps/Music
mm
@ameerkat
ameerkat / BoyerMooreStringSearch.py
Created Oct 14, 2010
Boyer Moore string search implementation in Python
View BoyerMooreStringSearch.py
# Boyer Moore String Search implementation in Python
# Ameer Ayoub <ameer.ayoub@gmail.com>
# Generate the Bad Character Skip List
def generateBadCharShift(term):
skipList = {}
for i in range(0, len(term)-1):
skipList[term[i]] = len(term)-i-1
return skipList
You can’t perform that action at this time.