Skip to content

Instantly share code, notes, and snippets.

@ii0
ii0 / drag_and_drop_helper.js
Last active June 12, 2019 10:05 — forked from rcorreia/drag_and_drop_helper.js
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@ii0
ii0 / git_proxy_socks5.sh
Created May 31, 2019 03:32 — forked from bluethon/git_proxy_socks5.sh
设置git使用socks5代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
@ii0
ii0 / sigmoidGraph.py
Created May 21, 2019 03:22 — forked from Will-777/sigmoidGraph.py
simple sigmoid function with Python
#import section
from matplotlib import pylab
import pylab as plt
import numpy as np
#sigmoid = lambda x: 1 / (1 + np.exp(-x))
def sigmoid(x):
return (1 / (1 + np.exp(-x)))
mySamples = []
@ii0
ii0 / ROI_pooling.py
Created May 10, 2019 09:22 — forked from Jsevillamol/ROI_pooling.py
ROI Pooling Layer
import tensorflow as tf
from tensorflow.keras.layers import Layer
class ROIPoolingLayer(Layer):
""" Implements Region Of Interest Max Pooling
for channel-first images and relative bounding box coordinates
# Constructor parameters
pooled_height, pooled_width (int) --
specify height and width of layer outputs
@ii0
ii0 / python_decorator_guide.md
Created May 7, 2019 06:28 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@ii0
ii0 / commentRemover.js
Created May 4, 2019 13:25 — forked from SudoPlz/commentRemover.js
A messy little js file that removes comments from any string passed into `stripComments(str)` function.
exports.stripComments = function stripComments(toBeStrippedStr){
//LEXER
function Lexer () {
this.setIndex = false;
this.useNew = false;
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments [i];
if (arg === Lexer.USE_NEW) {
this.useNew = true;
}
tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal.
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila.
Since the title was about centos 7, then do the following step to install tmux.
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default.
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ tar xzvf libevent-2.0.21-stable.tar.gz
$ cd libevent-2.0.21-stable
@ii0
ii0 / console-log-14.04.txt
Created April 29, 2019 07:10 — forked from suriya/console-log-14.04.txt
Demonstrating that Gunicorn does not respond immediately to SIGTERM (with Python 3.5)
The script run-and-stop-gunicorn.sh takes 1 second on both Python 2.7 and 3.4.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
$
$
$ source 27-env/bin/activate