Skip to content

Instantly share code, notes, and snippets.

@RGBD
RGBD / default.log
Last active August 29, 2015 14:21
Test Parser and RuboCop
rubocop -V: 0.31.0 (using Parser 2.2.2.2, running on ruby 2.2.1 x86_64-linux)
--------------------------------standalone_class--------------------------------
# before class C
class C
def foo; end
end # end class C
----------------------------------associations----------------------------------
(class
(const nil :C) nil
(def :foo
@RGBD
RGBD / num-an
Last active December 31, 2016 10:12
num-an
Numerical Analysis Methods Implementations
@RGBD
RGBD / .vimrc
Last active July 22, 2021 16:53
Well, someone asked for it.
set nocompatible
filetype off
call plug#begin('~/.vim/bundle')
"Plug 'gmarik/Vundle.vim'
"# Plugins
"## Appearance
Plug 'altercation/vim-colors-solarized'
// ==UserScript==
// @name rubylovo
// @namespace rubylovo.rubyroidlabs.com/
// @description rubylovo bot
// @include http://rubylovo.rubyroidlabs.com/
// @version 1
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
@RGBD
RGBD / fancy_show.py
Last active December 31, 2016 10:15
Python fancy show list of images
def fancy_show(imgs, *, n_cols=None, fig_dim=None):
if type(imgs) == numpy.ndarray:
imgs = [imgs]
if len(imgs) == 1:
n_rows = 1
n_cols = 1
if fig_dim == None:
fig_dim = 10
figsize = (fig_dim, fig_dim)
else:
@RGBD
RGBD / pb
Last active December 28, 2016 20:09
pb --- ptpb.pw pastebin wrapper
#!/bin/bash
pb_url='http://ptpb.pw'
echo2() { echo "$@" 1>&2; }
usage() {
name="$(basename "$0")"
echo2 "$name: pastes to or fetches text from '$pb_url'"
echo2 "usage: $name [path]"
#!/bin/bash
message() {
date -Is
hostname
whoami
who
ip addr
}
require 'time'
name = 'john'
a = <<-SQL
INSERT INTO `users`(name, updated_at)
values(
#{name},
#{Time.now.iso8601}
)
@RGBD
RGBD / twitch-recorder.py
Created July 28, 2019 17:27 — forked from junian/twitch-recorder.py
Record Twitch Streams Automatically in Python
# This code is based on tutorial by slicktechies modified as needed to use oauth token from Twitch.
# You can read more details at: https://www.junian.net/2017/01/how-to-record-twitch-streams.html
# original code is from https://slicktechies.com/how-to-watchrecord-twitch-streams-using-livestreamer/
import requests
import os
import time
import json
import sys
import subprocess