Skip to content

Instantly share code, notes, and snippets.

View fivejjs's full-sized avatar
🏠
Working from home

vfive fivejjs

🏠
Working from home
  • Data scientist and engineer
  • Sydney Australia
View GitHub Profile
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 9, 2024 12:41
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@cbur24
cbur24 / crop_mask_feature_layer.py
Last active April 19, 2021 04:43
Feature layer function for production run of eastern crop-mask
import datacube
import numpy as np
import xarray as xr
from odc.algo import xr_reproject
from pyproj import Proj, transform
from datacube.utils.geometry import assign_crs
from datacube.testutils.io import rio_slurp_xarray
from deafrica_tools.bandindices import calculate_indices
def common_ops(ds, era):
@spacegangster
spacegangster / user.clj
Last active March 24, 2022 12:16
Getting call graph (vars structure) in Clojure
(ns user)
; Hey, I've been playing a bit with graphing out the structure of a module for Lightpad.
; It worked well, I've found the target function that I'll need change to add a new feature.
; Tweet with a screenshot https://twitter.com/spacegangster/status/1324760381735272450
; lein coordinate
; [com.gfredericks/clj-usage-graph "0.3.0"]
; https://github.com/gfredericks/clj-usage-graph
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 9, 2024 13:26
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@fivejjs
fivejjs / docker-cheat-sheat.md
Created May 9, 2019 02:00 — forked from dwilkie/docker-cheat-sheat.md
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@AruniRC
AruniRC / bbox_iou_evaluation.py
Created February 22, 2018 16:10
Object detector util: match a set of detected bounding boxes and a set of ground-truth bounding boxes
from __future__ import division
import scipy.optimize
import numpy as np
def bbox_iou(boxA, boxB):
# https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/
# ^^ corrected.
# Determine the (x, y)-coordinates of the intersection rectangle
xA = max(boxA[0], boxB[0])
@apeckham
apeckham / upsert.clj
Last active June 9, 2022 23:42
clojure jdbc copy into temporary table with upsert
(def t (java.io.File/createTempFile "filename" ".txt"))
(println (.getPath t))
(defn row [n]
[(+ n 500000) (rand-int 10000) (rand-int 10000) (rand-int 10000) (rand-int 10000) 5550555 (rand) "hello world"])
(with-open [w (io/writer t)]
(csv/write-csv w (map row (range 1000000))))
(j/with-db-transaction [tx db-spec]

傅立叶变换的物理意义

原创 2016-04-08 yangboy2

昨天我们分享了一篇《FFT结果的物理意义》一文,有些网友表示看不大明白,为此我们整理重发一篇去年分享过的《傅里叶变换的物理意义》一文,以便大家更好的理解。

1. 先看下面的两幅动画,增加对傅立叶变换的印象

@karpathy
karpathy / nes.py
Last active October 23, 2023 17:50
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.