Skip to content

Instantly share code, notes, and snippets.

View evie404's full-sized avatar

Evelyn Pai evie404

View GitHub Profile
backlog ntpserver pool.ntp.org;
time 0;
// PST
timestd 0,1,11,1,2,-480;
timedst 0,2,3,1,2,-420;
// MST
timestd 0,1,11,1,2,-420;
timedst 0,2,3,1,2,-360;
@evie404
evie404 / synology_disk_benchmark.sh
Last active November 26, 2020 14:49 — forked from gxfxyz/synology_disk_benchmark.sh
A simple script to test Synology NAS disk speed with hdparm, dd and fio
#!/usr/bin/env bash
# =======================================================================================
#
# A simple script to test Synology NAS disk speed with hdparm, dd and fio.
#
# How to use:
#
# 1. Save synology_disk_benchmark.sh and xfio.conf to your Synology NAS
# 2. Make it executable: chmod +x synology_disk_benchmark.sh
SELECT DATE_TRUNC('month', created_at) AS month, sum(count(created_at)) OVER (ORDER BY DATE_TRUNC('month', created_at)) FROM thing GROUP BY DATE_TRUNC('month', created_at);
@evie404
evie404 / copy_bones.py
Created July 10, 2020 16:09
Blender copy bones
import bpy
destination_armature = bpy.data.objects['Destination Armature']
destination_root = destination_armature.pose.bones.get("ROOT_GROUND")
source_armature = bpy.data.objects['Source Armature']
source_root = source_armature.pose.bones.get("ROOT_GROUND")
bones = []
load("@bazel_gazelle//:deps.bzl", "go_repository")
# github_go_repository is a wrapper around go_repository to make the fetching of github repos easier
# by converting git clones to http archive downloads. The latter is fast, more reliable, actually
# cachable, and actually recommended by the Bazel team.
# It does have some caveats, so it's not meant to be a complete replacement of `go_repository`.
def github_go_repository(
name,
importpath,
commit,
@evie404
evie404 / gist:fd577a8f0bfbb19246bff0d497a93239
Created June 15, 2019 05:34 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login rickypai
password SECRET
machine api.github.com
login rickypai
password SECRET
@evie404
evie404 / isSorted.scala
Created September 25, 2018 17:35
scala learning
def isSorted[A](as: Array[A], ordered: (A,A) => Boolean): Boolean = {
def go[A](as: Array[A], ordered: (A, A) => Boolean, acc: Int): Boolean = {
if (acc == 2) {
ordered(as(0), as(1))
} else {
if (ordered(as(acc - 2), as(acc - 1))) {
go(as, ordered, acc - 1)
} else {
false
}

Managing multiple-versions of Bazel with Homebrew

If you work with multiple repositories that require different versions of Bazel, this guide might help.

Installing a version of Bazel

Homebrew has a mechanism for installing an older version of a particular package. The details are in this Stackoverflow answer for those interested.

The general idea is to find the particular SHA of homebrew-core and install the bazel formula from a particular commit. You can find the history of all Bazel recipe changes in: https://github.com/Homebrew/homebrew-core/commits/master/Formula/bazel.rb.

@evie404
evie404 / node.rb
Last active July 30, 2018 18:14
Node formula for 8.11
class Node < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
stable do
url "https://nodejs.org/dist/v8.11.3/node-v8.11.3.tar.xz"
sha256 "577c751fdca91c46c60ffd8352e5b465881373bfdde212c17c3a3c1bd2616ee0"
# We track major/minor from upstream Node releases.
# We will accept *important* npm patch releases when necessary.
@evie404
evie404 / interview.go
Last active May 1, 2018 17:11
interview snipplet
package main
import "fmt"
func plusone(a int) int {
return a + 1
}
type testCase struct {
input int