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 os | |
import base64 | |
import requests | |
import json | |
def get_cloudiness(image_path): | |
# 读取OpenAI API Key | |
api_key = os.getenv('OPENAI_API_KEY') | |
if not api_key: |
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
""" | |
A class supporting the auto-focusing of a telescope. | |
""" | |
from astropy.io import fits | |
from astropy.stats import sigma_clipped_stats | |
from photutils.detection import DAOStarFinder | |
from glob import glob | |
from tqdm import tqdm | |
from typing import List, Dict, Any | |
from time import time |
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 zwoasi | |
import cv2 | |
import numpy as np | |
from simple_pid import PID | |
from alpaca import Telescope | |
def initializeCamera(): | |
zwoasi.init('./ASICamera2.dll') | |
camera = zwoasi.Camera(0) | |
controls = camera.get_controls() |
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
# Initial imports | |
import os | |
import sys | |
import logging | |
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) | |
from caffe2.proto import caffe2_pb2 | |
import numpy as np | |
import skimage.io | |
import skimage.transform |
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
set -g default-terminal "screen-256color" | |
set -g status-right '#[fg=black] #(hostname), %H:%M, #(uptime | egrep -o "average.*"|perl -pe "s|average: ||")' | |
setw -g automatic-rename | |
# mouse mode | |
set -g mode-mouse on | |
setw -g mouse-select-window on | |
setw -g mouse-select-pane on | |
setw -g mode-keys vi |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Example aliases |
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 apt-get install llvm cython python-pip python-llvm | |
git clone https://github.com/numba/numba.git # Not sure whether this is necessary | |
cd numba | |
sudo pip install -r requirements.txt | |
sudo pip install numba |
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
<? | |
$r = 'This is an automatically generated message notifying you that someone pushed new commits to the github repo <project>.' . " Don't forget to do git pull before your editing.\r\n\r\nEdit summary: \r\n"; | |
$payload = $_REQUEST['payload']; | |
preg_match_all('@"name":"([\w ]*?)","email@', $payload, $matches); | |
$authors = $matches[1]; | |
preg_match_all('@"message":"([^"]*)"@', $payload, $matches); | |
$messages = $matches[1]; | |
preg_match_all('@"url":"([^"]*)"@', $payload, $matches); | |
$links= $matches[1]; | |
for ($i = 0; $i < count($messages) - 1; ++$i) |
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
function newImg = register(imgfn, dfn, idxfn) | |
% rectify the color image according to the depth and the alignment | |
% information from the data collection program | |
% Consult http://grapeot.me/some-technical-details-about-kinectfusion.html for more details. | |
%% read in the data | |
fp = fopen(imgfn, 'r'); | |
imgRaw = fread(fp, 'char'); | |
imgRaw = reshape(imgRaw, 4, 640, 480); | |
for i = 1: 3 |
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
num=$(curl -s xkcd.com | grep -oh -m 1 'v" href="/[0-9]*' | sed 's/v" href="\/'//) | |
n=$[ $RANDOM % $num ] | |
curl -s xkcd.com/$n/ | grep '<img.*comics' | mail -a 'Content-Type: text/html' -s 'xkcd daily pick' <email> |
NewerOlder