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 bash | |
# note: clang-tidy only accepts one file at a time, but we can run it | |
# parallel against disjoint collections at once. | |
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n1 -P4 cleanup-tidy | |
# clang-format accepts multiple files during one run, but let's limit it to 12 | |
# here so we (hopefully) avoid excessive memory usage. | |
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n12 -P4 cleanup-format -i |
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 bash | |
clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, AllowShortFunctionsOnASingleLine: None, KeepEmptyLinesAtTheStartOfBlocks: false}" "$@" |
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 bash | |
clang-tidy \ | |
-fix \ | |
-fix-errors \ | |
-header-filter=.* \ | |
--checks=readability-braces-around-statements,misc-macro-parentheses \ | |
$1 \ | |
-- -I. |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
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
# i3status configuration file. | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! | |
general { | |
colors = true |
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
# We want to set the prefix to C-a. C-b is kind of awkward. C-a works well if | |
# CAPSLOCK is remapped to Ctrl. | |
set -g prefix C-a | |
unbind C-b | |
# We want to imitate WMs like i3 and allow tmux to reload its config in a few | |
# keystrokes. | |
bind r source-file ~/.tmux.conf | |
# We never want to use the mouse. |
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 python2 | |
from z3 import * | |
import math | |
# RAID-4 Non-Rotating Parity 0 | |
class RealBlock(object): | |
def __init__(self, k, i, j, v): | |
self.k = k | |
self.i = i |
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/python | |
# Assume there is a 50 storey building and it has 4 lifts. You have to write a | |
# scheduler program for the lifts. All the 4 lifts will be controlled by | |
# single program and Waiting time for peoples waiting for lift should be | |
# minimum. | |
# | |
# Using the Nearest Car approach described at http://www.quora.com/Is-there-any-public-elevator-scheduling-algorithm-standard | |
# | |
# Some assumptions include direction of lift at top floor will always be down, | |
# and on ground floor it will be up. More assumptions obvious from the code. |
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
VERSION BUILD=6011206 RECORDER=CR | |
URL GOTO=http://a.drupal.website/admin/content/node | |
'REFRESH | |
WAIT SECONDS=1 | |
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:node-admin-content ATTR=* CONTENT=YES | |
TAG POS=1 TYPE=SELECT FORM=ID:node-admin-content ATTR=ID:edit-operation CONTENT=%delete | |
SET !TIMEOUT 2 | |
SET !ERRORIGNORE YES | |
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:node-admin-content ATTR=ID:edit-submit-1 | |
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:node-admin-content ATTR=ID:edit-submit |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
type LnFile struct { | |
Count int |