This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import locale | |
import csv, codecs, cStringIO | |
from pprint import pprint | |
import time | |
from BeautifulSoup import BeautifulSoup | |
# From the Pyton documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
nmsmax(fun, x[, trace = true, initial_simplex = 0, target_f = Inf, max_its = Inf, max_evals = Inf, tol = 1e-3]) | |
Nelder-Mead simplex method for direct search optimization. | |
This function attempts to maximize the function `fun`, using the | |
starting vector `x`. The Nelder-Mead direct search method is used. | |
Adaption of the original *MATLAB* source by Nick Higham to *Julia*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authored by Konrad Kollnig | |
# Oxford, 20 April 2019 | |
import wikipedia | |
from nltk.tokenize import sent_tokenize, RegexpTokenizer | |
from nltk.corpus import stopwords | |
from collections import defaultdict | |
import math | |
import numpy as np | |
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const parseDomain = require("parse-domain"); | |
function readJson(filename) { | |
return JSON.parse( | |
fs.readFileSync(filename) | |
); | |
} | |
function getDomain(url) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
super_genres = { | |
'ART_AND_DESIGN': 'Art & Photography', | |
'AUTO_AND_VEHICLES': 'Productivity & Tools', | |
'BEAUTY': 'Health & Lifestyle', | |
'BOOKS_AND_REFERENCE': 'Productivity & Tools', | |
'BUSINESS': 'Productivity & Tools', | |
'COMICS': 'Games & Entertainment', | |
'COMMUNICATION': 'Communication & Social', | |
'DATING': 'Communication & Social', | |
'EDUCATION': 'Education', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import urllib.request, json | |
import argparse | |
parser = argparse.ArgumentParser(description='Compare Shavar and Disconnect.me blacklist.') | |
parser.add_argument("-f", "--file", help="blacklist to verify") | |
args = parser.parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage:./grant_ios_permissions.sh [bundleId] | |
# Example: ./grant_ios_permissions.sh com.spotify.client | |
echo "This does not grant location, notification or local network permission. You can grant location permission with this script https://gist.github.com/kasnder/91a64a555e962d08cd05b52f7114b897 and the notifications permission with this script https://gist.github.com/kasnder/c17752607486042fc4f8bd4f61bb2c43 and local network permission with this script https://gist.github.com/kasnder/7076fe8eaea51948e5cda7a01e343ff5" | |
# Requirements: | |
# - iOS 14.8 device with checkra1n jailbreak | |
# - Installed `sqlite3` on iOS device from Cydia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Todo: This currently fails to replace an existing entry in the location permission database. Would be better add to the end of the clients.plist file. | |
# Usage:./grant_ios_location_permission.sh [bundleId] | |
# Example: ./grant_ios_location_permission.sh com.spotify.client | |
# Requirements: | |
# - iOS device with checkra1n jailbreak (tested on 14.8) | |
# - Installed `sqlite3` on iOS device from Cydia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%insert before \begin{document} | |
\usepackage{wrapfig} | |
\makeatletter% | |
\newenvironment{responsivefig}[2]{% | |
\if@twocolumn% | |
\begin{figure}% | |
\else% | |
\wrapfigure{#1}{#2}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script runs on macOS | |
# One needs a working, passwordless SSH login with login 'ios' on a jailbroken iOS 14.+ | |
# One also needs Activator and ActivatorCrashFix14: https://stackoverflow.com/questions/21706050/how-to-unlock-ios-screen-programmatically) | |
# Backup and preparation | |
ssh ios "cp -n /var/mobile/Library/BulletinBoard/VersionedSectionInfo.plist ~/VersionedSectionInfo.plist.bak" | |
scp ios:/var/mobile/Library/BulletinBoard/VersionedSectionInfo.plist ./VersionedSectionInfo2.plist | |
# Prepare notification settings | |
/usr/libexec/PlistBuddy -c "Set :\$objects:2 $appId" `pwd`/base2.plist |
OlderNewer