Skip to content

Instantly share code, notes, and snippets.

View amicoding
[2019-11-05T10:16:56-05:00] [2019-11-05T10:21:56-05:00]
[2019-11-05T01:15:54-05:00] [2019-11-05T01:31:55-05:00]
[2019-11-05T01:00:53-05:00] [2019-11-05T01:13:19-05:00]
@brandonsimpson
brandonsimpson / reinstall_git_brew.md
Last active Jun 6, 2020
Re-installing Git on Mac OSX with Brew
View reinstall_git_brew.md

Re-installing Git on Mac OSX with Brew

This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

  1. Check which git you're running:
    which git
    
View Disable Device Enrollment Notification on Mac.md

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@rama982
rama982 / hosts_miui.txt
Last active Jun 6, 2020
Hosts for blocking MIUI from calling back home
View hosts_miui.txt
0.0.0.0 10.235.124.13
0.0.0.0 10.99.168.145
0.0.0.0 10.99.184.96
0.0.0.0 a.stat.xiaomi.com
0.0.0.0 abtest.mistat.intl.xiaomi.com
0.0.0.0 abtest.mistat.xiaomi.com
0.0.0.0 account.jetbrains.com
0.0.0.0 account.preview.n.xiaomi.net
0.0.0.0 account.xiaomi.com
0.0.0.0 ad.mi.com
@deviantony
deviantony / README.md
Last active Jun 6, 2020
Portainer HTTP API by example
View README.md

Introduction

This document presents a simple way to manage your Docker resource by using Portainer as a gateway (HTTP queries against the Portainer API).

The API documentation is available here: https://app.swaggerhub.com/apis/deviantony/portainer/

WARNING: This documentation is valid for Portainer >= 1.18.0.

NOTE: I'm using httpie to execute HTTP queries from the CLI.

@sgnl
sgnl / postgres-brew.md
Last active May 4, 2020
Installing Postgres via Brew (OSX) (outdated see top most note)
View postgres-brew.md

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
View Mixture_of_softmaxes.py
# PyTorch code For implementing the mixture of softmaxes layer from
# "Breaking the Softmax Bottleneck: A High-Rank RNN Language Model"
# https://arxiv.org/abs/1711.03953
context = self.fc(out)
# Non-log version
priors = F.softmax(context[:,-self.n_components:])
mixtures = torch.stack([priors[:,i].unsqueeze(1) * F.softmax(context[:, i * self.nClasses : (i + 1) * self.nClasses]) for i in range(self.n_components)],1)
out = torch.log(mixtures.sum(1))
@glnds
glnds / less-cheatsheet.md
Last active May 21, 2020
Less Cheatsheet
View less-cheatsheet.md

Less Cheatsheet

less {filename}
Navigation
SPACE forward one window
b backward one window
d forward half window
View wemos-d1-mini-esp8266-rfid-rc522.ino
/**
Useful links
https://wiki.wemos.cc/products:d1:d1_mini
https://cdn-images-1.medium.com/max/1400/1*YKc8KpAfMrlhrOLmNjdRwQ.png (D1 full pinout)
https://github.com/Jorgen-VikingGod/ESP8266-MFRC522
https://github.com/miguelbalboa/rfid
d1 mini rc52 wiring
https://discourse-cdn-sjc1.com/business5/uploads/mydevices/original/2X/e/ecedba79dc05f2c0b02b7fba8b3da2681590a11a.jpg
You can’t perform that action at this time.