Skip to content

Instantly share code, notes, and snippets.

@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@nufeng1999
nufeng1999 / InstallWSA.md
Last active April 19, 2024 00:02
[安装 Windows Subsystem for Android™️ ] 安装 Windows Subsystem for Android™️

1.获得 WAS 微软商店链接地址

https://www.microsoft.com/store/productId/9P3395VX91NR

2.下载 WAS 安装包

安装包抓包网址
https://store.rg-adguard.net/ 在这里输入上述商店链接,右边要选择Slow通道
(共有四个选项,分别是Fast,Slow,RP和Retail,分别对应Windows的Dev渠道,Beta渠道,RP渠道和正式版,目前只有Beta版本有发布)
找到最下面名为
"MicrosoftCorporationII.WindowsSubsystemForAndroid_*.msixbundle"
的包进行下载,即可获取最新的Beta版本的抓包

@rrufai
rrufai / lean_trader.coffee
Created January 17, 2018 19:05
Infrequent EMA crossover trading Bot
###
The script engine is based on CoffeeScript (http://coffeescript.org)
The Cryptotrader API documentation is available at https://cryptotrader.org/api
EMA CROSSOVER TRADING ALGORITHM
The strategy enters buy orders when the short-term EMA crosses above the long-term EMA
or enters sell orders when the short-term EMA crosses below the long-term EMA.
@kentblakely
kentblakely / lean_trader.coffee
Created April 19, 2024 00:00 — forked from rrufai/lean_trader.coffee
Infrequent EMA crossover trading Bot
###
The script engine is based on CoffeeScript (http://coffeescript.org)
The Cryptotrader API documentation is available at https://cryptotrader.org/api
EMA CROSSOVER TRADING ALGORITHM
The strategy enters buy orders when the short-term EMA crosses above the long-term EMA
or enters sell orders when the short-term EMA crosses below the long-term EMA.
@ryanburgess
ryanburgess / IE7.js
Created January 1, 2014 22:15
IE7.js is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.
<!--[if lt IE 7]><script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script><![endif]-->
@valichek
valichek / gist:ba510de9ff2cf3d0c502
Created May 5, 2014 21:12
Strange behaviour of merge and into with map where keys are instances of AsyncChannel from http-kit
(ns clj-test-server.core
(:use org.httpkit.server))
; https://github.com/http-kit/http-kit/blob/master/src/java/org/httpkit/server/AsyncChannel.java
(def clients (atom nil))
(defn handler []
(future (let
[merged (merge {} @clients)]
@jxmorris12
jxmorris12 / torch_ddp_verify.py
Last active April 18, 2024 23:54
verify parameter weights & gradients in pytorch
def verify_ddp_weights_equal(model: torch.nn.Module, atol: float = 1e-5) -> None:
if hasattr(model, "module"):
model = model.module
world_size = get_world_size()
for name, param in model.named_parameters():
gathered_param = gather(param).reshape((world_size, -1))
absolute_diffs = (gathered_param[None, 0, :] - gathered_param).abs()
rank_params_eq = (absolute_diffs < atol).all()
assert rank_params_eq, f"❌ param [{name}] not equal - got max_absolute_diff={absolute_diffs.max()}"
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active April 18, 2024 23:53
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

@reyrarnfredur
reyrarnfredur / links.md
Last active April 18, 2024 23:51
List of resources for game design I am interested in and/or currently using.