Skip to content

Instantly share code, notes, and snippets.

@wilvk
wilvk / Github.js
Last active May 16, 2018 10:14
How to implement a Github icon in material-ui-next
import React from 'react';
import SvgIcon from '@material-ui/core/SvgIcon';
class GithubIcon extends React.Component {
render() {
return (
<SvgIcon {...this.props}>
<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2 0 1.9 1.2 1.9 1.2 1 1.8 2.8 1.3 3.5 1 0-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.2.5-2.3 1.3-3.1-.2-.4-.6-1.6 0-3.2 0 0 1-.3 3.4 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.8 0 3.2.9.8 1.3 1.9 1.3 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.9 1 .9 2.2v3.3c0 .3.1.7.8.6A12 12 0 0 0 12 .3" />
</SvgIcon>
@wilvk
wilvk / for_bashrc
Created July 15, 2018 01:51
Get gmt time
gmttime () {
curl http://s3.amazonaws.com -v 2>&1 | grep "Date: " | awk '{ print $3 " " $5 " " $4 " " $7 " " $6 " GMT"}'
}
@wilvk
wilvk / .tmux.conf
Created September 18, 2018 00:26
tmux settings for mac
set-window-option -g mode-keys vi
set -g history-limit 999999
bind-key -r k select-pane -U
bind-key -r j select-pane -D
bind-key -r h select-pane -L
bind-key -r l select-pane -R
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
@wilvk
wilvk / actionable_dict.py
Created December 22, 2018 05:52
A Python Dictionary that can be used for notifications of nested dictionary changes
class ActionableDict(dict):
parent = None
def __init__(self, initial_dict, parent = None):
self.parent = parent
for key, value in initial_dict.items():
if isinstance(value, dict):
initial_dict[key] = ActionableDict(value, self)
super().__init__(initial_dict)
@wilvk
wilvk / index.js
Last active March 21, 2019 10:30
example sync file api in node/express
var express = require('express');
var fs = require('fs');
var app = express();
var port = process.env.PORT || 8080;
app.get('/api', function(req, res) {
var contents = fs.readFileSync('DATA.txt', 'utf8');
res.send("test info: " + contents);
});
" begin vundle code
filetype plugin indent off
syntax off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Bundle 'nickspoons/vim-sharpenup'
Bundle 'puremourning/vimspector'
Bundle 'dense-analysis/ale'
Bundle 'RRethy/vim-illuminate'
Bundle 'inside/vim-search-pulse'