Skip to content

Instantly share code, notes, and snippets.

Nil-Zil

Block or report user

Report or block Nil-Zil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Nil-Zil
Nil-Zil / tasks.json
Last active Jul 26, 2017
vscode tasks config
View tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "watchers",
"args": [],
"suppressTaskName": true,
"isShellCommand": false,
"tasks": [{
"taskName": "browserify",
View sort_listD_by_list_A.py
#!/usr/bin/env python3
# created at Jun 23, 2017 21:04 by Nil-Zil
"""
Sort list d, e, f by the elements in a, b, c.
"""
from operator import itemgetter
import numpy as np
View loading-MathJax-Dynamically.js
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
var config = 'MathJax.Hub.Startup.onload();';
if (window.opera) {script.innerHTML = config}
else {script.text = config}
View mkoutputdir.py
#!/usr/bin/env python3
# created at Jun 6, 2017 00:45
import os
if not os.path.exists("build.noindex/"):
os.makedirs("build.noindex/")
View memfree.rb
#!/usr/bin/env ruby
# encoding: utf-8
if `uname`.strip == "Darwin"
def get_paged_memory_usage(match_string, paging=4096)
mvar = 3
if match_string.split(/[^\w]/).length > 1
mvar = 4
end
paged_val = `vm_stat | grep "Pages #{match_string}:" | awk '{ print $#{mvar}}'`.to_i
View create_folder.py
import os
my_path = os.path.abspath(__file__ + "/../../")
if not os.path.exists(my_path + "/folder"):
os.makedirs(my_path + "/folder")
@Nil-Zil
Nil-Zil / plotlyresize.js
Created May 29, 2017
Adjust Plotly's plot size responsively according to window motion
View plotlyresize.js
// Some info about viewport percentages:
// http://stackoverflow.com/questions/1575141/make-div-100-height-of-browser-window
// Code from https://codepen.io/plotly/pres/wKpPvj
(function() {
var d3 = Plotly.d3;
var WIDTH_IN_PERCENT_OF_PARENT = 60,
HEIGHT_IN_PERCENT_OF_PARENT = 80;
@Nil-Zil
Nil-Zil / npm-upgrade-bleeding.sh
Created May 27, 2017 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
View npm-upgrade-bleeding.sh
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@Nil-Zil
Nil-Zil / cask_upgrade.sh
Created May 27, 2017 — forked from atais/cask_upgrade.sh
Script upgrading outdated brew casks
View cask_upgrade.sh
#!/usr/bin/env bash
(set -x; brew update;)
(set -x; brew cleanup;)
(set -x; brew cask cleanup;)
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
View smaller_ruled_top_blank
\documentclass{article}
\usepackage{tikz}
\usepackage{pagecolor}
\usepackage[paperwidth=8.27in,paperheight=11.7in]{geometry}
\definecolor{h}{rgb}{0.8,0.85,0.77}
\definecolor{bg}{rgb}{0.99,0.97,0.81}
\begin{document}
\pagestyle{empty}
You can’t perform that action at this time.