Skip to content

Instantly share code, notes, and snippets.

View NigoroJr's full-sized avatar

Naoki Mizuno NigoroJr

  • Ohio, United States
View GitHub Profile
@NigoroJr
NigoroJr / display.rb
Created April 9, 2016 12:24
Displays 7-segment digits
#!/usr/bin/env ruby
# Example usage:
# $ cat <<EOS | this_script
# 16:47
# 23:59
# 00:08
# end
# EOS
#
@NigoroJr
NigoroJr / shuffle.rb
Last active March 11, 2016 20:27
Randomly shuffle and sample arguments
#!/usr/bin/env ruby
# Example usage in zsh:
#
# mplayer ${(f@)"$( this_script ~/Music/*.mp3 )"}
require 'slop'
opts = Slop.parse do |o|
o.integer '-s', '--sample', 'Number of samples to take', default: 0
@NigoroJr
NigoroJr / cpp_on_windows_vim.md
Last active January 16, 2023 19:32
A guide for setting up C++ development environment on Windows

Set up a basic C++ development environment on Windows

What this guide is

This guide aims to walk you through setting up an environment for doing C++ development on Windows using cygwin, gvim, and the mighty command prompt.

@NigoroJr
NigoroJr / install_stuff.sh
Last active March 12, 2016 20:35
Installer for machines you don't have admin privileges
#!/bin/bash
# Usage: Run this script with -h for help.
#
# License: {{{
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
@NigoroJr
NigoroJr / chrome
Created February 17, 2016 19:57
Wrapper for starting Chrome in Mac
#!/usr/bin/env zsh
local opts addr
opts='--incognito'
while getopts 'hs:g:n' flag; do
case "$flag" in
n)
opts=''
;;
#!/usr/bin/env zsh
# Depending on the version of zplug that you are currently using, this
# function symlinks the other zplug version to $ZPLUG_HOME.
#
# $ git clone https://github.com/b4b4r07/zplug ~/.zplug_v1
# $ git clone https://github.com/b4b4r07/zplug2 ~/.zplug_v2
# $ source ~/.zplug_v1/zplug
# $ source this_script
# # Use v2
source 'https://rubygems.org'
gem 'nokogiri'
gem 'slop'
@NigoroJr
NigoroJr / tm-normal
Last active February 17, 2016 19:54
Create a tmux session with 7 windows
#!/bin/sh
S='tm-normal'
tmux new-session -d -s $S -n 'local'
tmux new-window -t $S:1 -d -n 'remote'
tmux new-window -t $S:2 -d -n 'programming'
tmux new-window -t $S:3 -d -n 'misc'
tmux new-window -t $S:4 -d -n 'others'
tmux new-window -t $S:5 -d -n 'stuff'
#include <iostream>
int main(int argc, char const* argv[]) {
int foo();
int& bar();
int* baz();
delete &(bar());
delete baz();
#include <iostream>
#include <queue>
struct Foo {
Foo(const int x) : x(x) {}
int x;
};
std::ostream& operator<<(std::ostream& os, const Foo& f) {
os << f.x;