Skip to content

Instantly share code, notes, and snippets.

View NigoroJr's full-sized avatar

Naoki Mizuno NigoroJr

  • Ohio, United States
View GitHub Profile
#!/usr/bin/env zsh
# If all of the following conditions are met, treats destination as file
# (i.e. mkdir the dirname, and move & rename to basename).
#
# - there is only one source
# - that source is a file
# - basename of the destination has an extension
#
# To suppress this behavior, use the -n option.
# ft=conf
Section "ServerLayout"
Identifier "layout"
Screen 1 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
#!/usr/bin/env ruby
class PCD
# PCD file must have fields precisely in this order
DATA_FIELDS = %w(
VERSION
FIELDS
SIZE
TYPE
COUNT
__zplug::sources::url::check()
{
local repo="$1"
local -A tags
__zplug::core::tags::parse "$repo"
tags=( "${reply[@]}" )
tags[dir]="$( echo $tags[dir] | sed -e "s#$tags[name]#${tags[name]:t:r}#" )"
// ==UserScript==
// @name Disable Ctrl
// @description Stops websites from stealing Ctrl keys
// @run-at document-start
// @include *
// @match https://*/*
// @match http://*/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@NigoroJr
NigoroJr / .zshrc
Last active September 14, 2016 11:47
local branch_name='fix-224-247-252'
if [[ -d ~/.zplug ]]; then
builtin cd -q ~/.zplug && git checkout $branch_name
else
git clone https://github.com/zplug/zplug ~/.zplug --branch $branch_name
fi
export ZPLUG_LOADFILE=
export ZPLUG_USE_CACHE=false
source ~/.zplug/init.zsh
# Description of behavior changes introduced in:
# https://github.com/zplug/zplug/commit/9b990d8d772eacdb0dac663bbc4bdf7de975aff6
#
# When the directory structure is as follows:
#
# ~/foo
# ├── bar
# │   └── func_a
# └── baz
# └── func_b
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
API_URL = 'http://opml.radiotime.com/Describe.ashx?id=s142523'
XPATH_HAS_SONG = '//has_song'
XPATH_CURRENT_SONG = '//current_song'
XPATH_CURRENT_ARTIST = '//current_artist'
#include <iostream>
#include <vector>
#include <stack>
#include <iterator>
#include <algorithm>
#include <string>
#include <unordered_map>
const std::unordered_map<char, unsigned> OPERATORS = {
{'*', 2},
#!/bin/sh
# Usage:
# ./rename_screenshots.sh -h
#
# Optios:
# -h Show help
# -d Directory where screenshots are saved
# -p Pattern of the files
# -s Remove spaces from file names