Skip to content

Instantly share code, notes, and snippets.

View mlzxy's full-sized avatar

Xinyu Zhang mlzxy

  • Rutgers University
  • New Brunswick, NJ
View GitHub Profile
@mlzxy
mlzxy / safe-rm.md
Last active March 23, 2022 08:21
Yet another `rm` alias

SAFE-RM

It behaves identically asrm except that it won't delete files with important or .keep (customizable through SAFE_RM_IMPORTANCE_MARK ). The idea is to mark important files beforehand so they can always survive future disk cleanup.

What triggered me to create this is I accidentally removed some baseline models, which I spent lots of GPU hours to train and all my current training jobs depend on. To prevent future disasters, I come up with this solution. Hope you find it useful too.

Demo

@zhreshold
zhreshold / train_imagenet.py
Last active April 28, 2018 04:19
Train imagenet using gluon
import argparse, time
import logging
logging.basicConfig(level=logging.INFO)
fh = logging.FileHandler('training.log')
logger = logging.getLogger()
logger.addHandler(fh)
import mxnet as mx
from mxnet import gluon
from mxnet.gluon import nn
@stvhwrd
stvhwrd / setup_tmux_zsh.sh
Last active July 9, 2020 04:20
Install tmux and zsh on a remote server without root
#!/usr/bin/env bash
# Connect to the server..
# ssh username@server_ip
mkdir ~/.local;
# Download source and build libevent
cd /tmp;
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz;
tar xvfz libevent-2.1.8-stable.tar.gz;
@quasoft
quasoft / pyqt4_systray_icon-example.py
Created October 15, 2016 20:25
Example on creating a cross platform system tray application in Python and Qt4
#!/usr/bin/env python3
import sys
from PyQt4 import QtGui
class SystemTrayIcon(QtGui.QSystemTrayIcon):
def __init__(self, icon, parent=None):
self.event_play_click = None
self.event_pause_click = None
self.event_exit_click = None
import tensorflow as tf
import numpy as np
if __name__ == '__main__':
np.random.seed(1)
# the size of the hidden state for the lstm (notice the lstm uses 2x of this amount so actually lstm will have state of size 2)
size = 1
# 2 different sequences total
batch_size= 2
# the maximum steps for both sequences is 10
@vmarkovtsev
vmarkovtsev / manual.md
Last active December 23, 2021 09:05
Installing VCMI on MacOSX El Capitan

Installing XCode

App Store -> XCode Launch it after the installation to agree with it's license terms.

Installing Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@mbohl
mbohl / ubuntu-bootcamp.txt
Created October 25, 2015 21:30
Bootcamp your Ubuntu partition
1. Install Ubuntu on the partition of your choosing
2. Install VMWare Fusion
3. Get Grub Super Disk 2 (http://www.supergrubdisk.org/category/download/supergrub2diskdownload/super-grub2-disk-stable/)
4. Determine which partition you have Ubuntu installed to using "diskutil list"
5. Create the VMWare Configuration
a. Create a new VM
b. "Create a Custom Virtual Machine"
c. Type "Linux->Ubuntu 64 bit"
d. Either use the defaults or customize to your needs.
6. Create the virtual disk mapping to the real partition (this assumes you use the default names)
@paulirish
paulirish / what-forces-layout.md
Last active July 5, 2024 08:26
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mlynch
mlynch / info.plist
Last active August 6, 2023 07:31
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)