Skip to content

Instantly share code, notes, and snippets.

View shuokay's full-sized avatar

Yushu Gao shuokay

View GitHub Profile
@b01
b01 / download-vs-code-server.sh
Last active April 22, 2024 14:22
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 25, 2024 01:09
crack activate Office on mac with license file
@liangfu
liangfu / winograd.py
Created November 19, 2017 06:19
winograd convolution in numpy
#!/usr/bin/python
# Copyright 2015-2016 Nervana Systems Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@Jamesits
Jamesits / ubuntu_enable_bbr.sh
Last active December 13, 2022 22:27
Ubuntu enable BBR
#!/bin/bash
set -eu
SYSCTL_FILE=/etc/sysctl.d/90-tcp-bbr.conf
# check root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@karpathy
karpathy / gist:7bae8033dcf5ca2630ba
Created May 5, 2015 07:31
Efficient LSTM cell in Torch
--[[
Efficient LSTM in Torch using nngraph library. This code was optimized
by Justin Johnson (@jcjohnson) based on the trick of batching up the
LSTM GEMMs, as also seen in my efficient Python LSTM gist.
--]]
function LSTM.fast_lstm(input_size, rnn_size)
local x = nn.Identity()()
local prev_c = nn.Identity()()
local prev_h = nn.Identity()()
@adam-p
adam-p / README.md
Created October 1, 2014 13:50
Patching Python code at runtime

A rather dirty way to patch module code at runtime.

@jdeng
jdeng / cluster
Last active June 17, 2020 02:52
clustering by fast search and find of density peak
// generate [0..n-1]
auto seq = [](size_t n) -> std::vector<size_t> {
std::vector<size_t> v(n);
for (size_t i=0; i<n; ++i) v[i] = i;
return v;
};
auto index = seq(n);
// n * n distance matrix
std::vector<D> dists(n * n);
@onauparc
onauparc / C++ Predict with caffe
Created June 17, 2014 13:36
sample code for caffe C++ prediction
#include <cuda_runtime.h>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <iostream>
#include <stdio.h>
#include "caffe/caffe.hpp"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k