This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ft=conf | |
Section "ServerLayout" | |
Identifier "layout" | |
Screen 1 "nvidia" | |
Inactive "intel" | |
EndSection | |
Section "Device" | |
Identifier "nvidia" | |
Driver "nvidia" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class PCD | |
# PCD file must have fields precisely in this order | |
DATA_FIELDS = %w( | |
VERSION | |
FIELDS | |
SIZE | |
TYPE | |
COUNT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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}#" )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <stack> | |
#include <iterator> | |
#include <algorithm> | |
#include <string> | |
#include <unordered_map> | |
const std::unordered_map<char, unsigned> OPERATORS = { | |
{'*', 2}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
NewerOlder