Skip to content

Instantly share code, notes, and snippets.

View s1db's full-sized avatar
🐑
Sheep

s1db

🐑
Sheep
View GitHub Profile
#!/bin/sh
# Script for installation of PRISM on a clean install of Ubuntu
set -e # Abort if one of the commands fail
set -x # Print commands as they are executed
# Install dependencies: make/gcc/Java/git
sudo apt-get -y update
sudo apt -y install make gcc g++ default-jdk git
#!/usr/bin/env python3
import random
from ortools.sat.python import cp_model
def generatePreferences(n, m):
'''
n - teams
m - customers
Randomly Generates Preferences of customer for n teams.
@s1db
s1db / custom-vscode-snippets.code-snippet
Last active August 12, 2020 18:07
My custom VSCode Snippets
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@s1db
s1db / hashtagdata.py
Created July 9, 2019 18:12
Python Twitter Hashtag Data Collection
import tweepy
import csv
# assuming twitter_authentication.py contains each of the 4 oauth elements (1 per line)
from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
api = tweepy.API(auth,wait_on_rate_limit=True)