This file contains hidden or 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
class Task(db.Model): | |
__tablename__ = 'task_tb' | |
id = db.Column(db.Integer, primary_key=True) | |
type = db.Column(db.String(SLen.NAME)) | |
arguments = db.Column(db.String(2000)) | |
created_at = db.Column(db.DateTime, default=func.now()) | |
__table_args__ = (UniqueConstraint('type', 'arguments', name='unique_task'),) |
This file contains hidden or 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
create table task_tb | |
( | |
id serial not null | |
constraint task_tb_pkey | |
primary key, | |
type varchar(110), | |
arguments varchar(2000), | |
created_at timestamp, | |
constraint unique_task | |
unique (type, arguments) |
This file contains hidden or 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 | |
# from constraint import * | |
# | |
# problem = Problem() | |
# | |
# problem.addVariable("Q400 Eco", [80, 0, 0]) | |
# problem.addVariable("Q400 Aff", [0, 44, 0]) | |
# problem.addVariable("Q400 First", [0, 0, 19]) | |
# problem.addVariable("ORY", [368, 107, 19, 4.25]) |
This file contains hidden or 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
daemon off; | |
#Heroku dynos have at least 4 cores. | |
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; | |
events { | |
use epoll; | |
accept_mutex on; | |
worker_connections 1024; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
var i = 0; | |
db.getCollection('fs.files').find({}).forEach(function(element){ | |
if (!db.getCollection('_User').find({profilePicture: element.filename}).toArray().length > 0){ | |
i++; | |
db.getCollection('fs.files').remove({filename: element.filename}) | |
} | |
}) | |
print(i) |
This file contains hidden or 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
alias ip="ifconfig | egrep -o '([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})[[:space:]]netmask[[:space:]]0x[[:xdigit:]]{8}[[:space:]]broadcast'|egrep -o '([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})' | pbcopy" |
This file contains hidden or 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 re | |
from subprocess import call | |
import sys | |
import os | |
rootdir = '.' | |
dictOfFilms = {} |
This file contains hidden or 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
for(var total=0,i=0;i<$("tbody").children().size();i++){var string=$($("tbody").children()[i]).children()[6].innerHTML,split=string.split(" ");value=parseFloat(split[0])*("MB"==split[1]?1:1e3),total+=value} |