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
''' | |
Keepvid video downloader by ongspxm | |
This script uses keepvid to download videos from streaming sites (youtube, etc). Currently, it is set to download 480p quality videos. Edit to fit your needs. | |
The links are to be entered in this format: | |
[name of file w/o extension] [link to video] | |
To automate the process, you can combine all of the links into a list. Then you can run the script in the following manner: |
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
module Jekyll | |
class CatIndex < Page | |
def initialize(site, base, dir, cat) | |
@site = site | |
@base = base | |
@dir = dir | |
@name = 'index.html' | |
self.process(@name) | |
self.read_yaml(File.join(base, '_layouts'), 'cat_index.html') | |
self.data['cat'] = cat |
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
#include <bits/stdc++.h> | |
#define let const auto | |
#define REP(var, i) for (int var = 0; var < i; ++var) | |
using namespace std; | |
using Int = int; | |
//using Int = long long; | |
using vi = vector<Int>; | |
using vvi = vector< vector<Int> >; | |
void solve() { |
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
" Colorscheme | |
colorscheme desert | |
syntax on | |
" Spaces & Tabs | |
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab | |
set autoindent | |
retab | |
" Wrapping |
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
import sys | |
from PIL import Image | |
try: | |
ifile = sys.argv[1] | |
ofile = sys.argv[2] | |
except: | |
print ('usage: dec.py [input file] [out file]\n\n') | |
img = Image.open(ifile) |
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 WIDTH = 128; | |
const COLOUR = document.getElementById("colour").getContext("2d"); | |
const HEIGHT = document.getElementById("height").getContext("2d"); | |
const COMBIN = document.getElementById("combin").getContext("2d"); | |
var X=WIDTH/2, Y=WIDTH/2; | |
var ANGLE=0, DOP=WIDTH/2; | |
var img_height = "https://cdn.glitch.com/3bb25b2e-fb56-49fd-96e9-a9af83d391d2%2Fheight.jpg?1513785075480"; | |
var img_color = "https://cdn.glitch.com/3bb25b2e-fb56-49fd-96e9-a9af83d391d2%2Fcolor.jpg?1513785075766"; |
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
# run with the starting index like so: `dload 5` | |
# first url on the list will be index-ed 5 | |
# pipe in list of urls | |
i=$1 | |
if [ -d $1 ]; then i=1; fi | |
while read f; do | |
name=$(echo $f | tr "/" "\n" | tail -n 1) |
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
import web | |
import requests | |
client_id = '<client id>' | |
client_secret = '<client secret>' | |
fb_graph = 'https://graph.facebook.com/v2.3/' | |
urls = [ | |
'/', 'Index', | |
'/login', 'Login' |
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
import java.util.*; | |
class Solution{ | |
ArrayList<Integer> weights, minWeights; | |
void run(){ | |
Scanner cin = new Scanner(System.in); | |
int T = cin.nextInt(); | |
for(int t=0; t<T; t++){ |
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
import math | |
import random | |
import matplotlib.pyplot as plt | |
import pickle | |
FNAME = "data.obj" | |
# generate 30 towns in a 1000*1000 grid | |
TOWN = 30 | |
GRID = 1000 |
NewerOlder