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 google.colab import drive | |
drive.mount('/content/drive') | |
root_path = 'drive/My Drive/your_project_folder/' #your project folder |
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 cv2 | |
import os | |
from os.path import isfile,join | |
input = '/' #folder of frames | |
output = 'framestovideo.mp4' #output path | |
fps = 25 #default 25 | |
frame_array = [] | |
frames = [f for f in os.listdir(input) if isfile(join(input, f))] |
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 | |
from astropy.timeseries import TimeSeries | |
from astropy.io import fits | |
class Lightcurve: | |
def __init__(self,path,telescope,instrument,date_obs_start,date_obs_end,creator,object,tessid,sector,camera,ccd,radesys,ra_obj,dec_obj,equinox, | |
pxtable,tessmag,radius,ticver,crmitten,crblksz,crspoc,checksum,time,timecorr,cadenceno,sap_flux,sap_flux_err,sap_bkg,sap_bkg_err, | |
pdcsap_flux,pdcsap_flux_err): | |
self.path = path | |
self.telescope = telescope |
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
df.columns = df.columns.str.strip().str.lower().str.replace(' ', '_').str.replace('(', '').str.replace(')', '') |
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
#Keras Models | |
#---Save---# | |
json_file = model.to_json() | |
with open(json_file_path, "w") as file: | |
file.write(json_file) | |
model.save_weights(h5_file) | |
#---Load---# | |
from keras.models import model_from_json |
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
// directory: pages/robots.txt.tsx | |
import React from 'react'; | |
const getRobots = () => `User-agent: * | |
Disallow: / | |
`; | |
class Sitemap extends React.Component { | |
public static async getInitialProps({res}:{ res:any }) { |
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
# ~/.conan/profiles/default | |
[settings] | |
os=Linux | |
os_build=Linux | |
arch=x86_64 | |
arch_build=x86_64 | |
build_type=Release | |
compiler=gcc | |
compiler.version=7.5 |
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 { useEffect } from "react" | |
import { useRouter } from "next/router" | |
export default function Custom404() { | |
const router = useRouter() | |
useEffect(() => { | |
router.replace("/") | |
}) | |
return 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/bash | |
user="$1" | |
pages=$(curl -I https://api.github.com/users/$user/starred | sed -nr 's/^link:.*page=([0-9]+).*/\1/p') | |
for page in $(seq 1 $pages); do | |
curl "https://api.github.com/users/$user/starred?page=$page&per_page=30" | jq -r '.[].html_url' | | |
while read rp; do | |
git clone $rp | |
done |
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
# Open document in fit-width mode by default | |
set adjust-open "best-fit" | |
# One page per row by default | |
set pages-per-row 1 | |
#stop at page boundries | |
set scroll-page-aware "true" | |
set smooth-scroll "true" #not working in zathura 0.4.5 | |
set scroll-full-overlap 0.01 |
OlderNewer