Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
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
########################################### | |
# serialization of indexes to byte arrays | |
########################################### | |
def serialize_index(index): | |
""" convert an index to a numpy uint8 array """ | |
writer = faiss.VectorIOWriter() | |
faiss.write_index(index, writer) | |
return faiss.vector_to_array(writer.data) |
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
""" | |
sort-of minimal end-to-end example of handling input sequences (sentences) of variable length in pytorch | |
the sequences are considered to be sentences of words, meaning we then want to use embeddings and an RNN | |
using pytorch stuff for basically everything in the pipeline of: | |
dataset -> data_loader -> padding -> embedding -> packing -> lstm -> unpacking (~padding) | |
based mostly on: https://github.com/HarshTrivedi/packing-unpacking-pytorch-minimal-tutorial | |
pytorch version 1.4.0 | |
gist url: https://gist.github.com/MikulasZelinka/9fce4ed47ae74fca454e88a39f8d911a | |
""" |
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
Download Google Drive files with WGET | |
Example Google Drive download link: | |
https://docs.google.com/open?id=[ID] | |
To download the file with WGET you need to use this link: | |
https://googledrive.com/host/[ID] | |
Example WGET command: |
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
# create a mongo app | |
flynn create --remote "" mongo | |
# create a release using the latest (at the time of writing) Docker MongoDB image | |
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50" | |
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up. | |
flynn -a mongo scale server=1 | |
# mongo should now be running in the cluster at mongo.discoverd:27017 |
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
//For "# min" type | |
var searchCorpus = $('a.lecture-link').text(); | |
var matches = searchCorpus.match(/(\d).+min/gm); | |
var bigResult = []; | |
for (index in matches) {bigResult.push(matches[index].match(/([\d]+)/g)[0]);} | |
var sum = 0; | |
for (index in bigResult) {sum = sum + parseInt(bigResult[index]);} | |
/*============================================= | |
= User Guide |
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
from PIL import Image | |
import os | |
import glob | |
import numpy as np | |
def crop(im, height, width): | |
# im = Image.open(infile) | |
imgwidth, imgheight = im.size | |
rows = np.int(imgheight/height) |
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 select | |
import socket | |
import sys | |
import objc | |
from PyObjCTools import AppHelper | |
objc.loadBundle("CoreBluetooth", globals(), | |
bundle_path=objc.pathForFramework(u'/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework')) |
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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once 'vendor/autoload.php'; | |
use Aws\S3\S3Client; | |
final class AWS_S3 | |
{ | |
private static $client = null; |
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/sh | |
# one way (older scala version will be installed) | |
# sudo apt-get install scala | |
#2nd way | |
sudo apt-get remove scala-library scala | |
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb | |
sudo dpkg -i scala-2.11.4.deb | |
sudo apt-get update |
NewerOlder