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 asyncio | |
import aiomysql | |
loop = asyncio.get_event_loop() | |
# async def main(all_done): | |
# """Get all messages.""" | |
# conn = await aiomysql.connect(host='127.0.0.1', port=3306, user='test', |
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 file is executed on every boot (including wake-boot from deepsleep) | |
def wifi_connect(): | |
import network | |
sta_if = network.WLAN(network.STA_IF) | |
if not sta_if.isconnected(): | |
sta_if.active(True) | |
sta_if.connect('ss', 'wifi') | |
while not sta_if.isconnected(): |
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
# Python virtual env alias | |
alias activate='test -d ENV && source ./ENV/bin/activate || echo "No Virtualenv in the current folder"' | |
alias mkenv='test -d ENV && echo "Already exists" || virtualenv --system-site-packages ENV; activate' |
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 matplotlib.pyplot as plt | |
from sklearn.datasets.base import load_data | |
from sklearn.utils import Bunch | |
from sklearn.decomposition import PCA | |
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis | |
def load_netflix(return_X_y=False): | |
data, target, target_names = load_data('/home/comtom/extra/netflix/', 'file1.csv') |
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 time | |
import datetime | |
with open('file1.csv', 'w') as output: | |
with open('combined_data_1.txt', 'r') as f: | |
currentMovieID = 0 | |
for line in f: | |
line = line.strip() |
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 bhtsne import tsne | |
from sklearn.datasets.base import load_data | |
from sklearn.utils import Bunch | |
import pandas as pd | |
import numpy as np | |
from ggplot import * | |
def load_netflix(return_X_y=False): | |
data, target, target_names = load_data('/home/comtom/extra/netflix/', 'file1-100mil.csv') |
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
sudo rename 's/(?<!\.)\b\w*/\u$&/g' * |
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
class IndexController extends CI_Controller { | |
function __construct() { | |
parent::__construct(); | |
$this->load->helper('captcha'); | |
$this->load->model('user', 'user'); | |
} | |
public function location($location_id) { | |
$this->index($location_id); | |
} | |
public function index($location_id = 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
FROM alpine:3.2 | |
RUN apk add --update ca-certificates && \ | |
apk add libc6-compat && \ | |
rm -rf /var/cache/apk/* /tmp/* | |
ADD micro /micro | |
WORKDIR / | |
ENTRYPOINT [ "/micro" ] |
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 alpine:3.7 | |
ENV KUBE_VERSION="v1.11.2" | |
ENV ANSIBLE_VERSION="2.5.0" | |
ENV TERRAFORM_VERSION="0.11.8" | |
# install kubectl | |
RUN set -ex \ | |
&& apk add --update ca-certificates \ | |
&& apk add --update -t deps curl \ |