/cpp/bin/
This file contains hidden or 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 | |
# First arg is always option | |
arg1="$1" | |
shift | |
# Find first non-option | |
for i in "$@"; do | |
if [[ -z "$dir" && "$i" != -* ]]; then | |
dir="$i" |
This file contains hidden or 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
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "trusty64" | |
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | |
config.vm.network :private_network, ip: "192.168.33.10" | |
config.vm.provision :docker | |
config.vm.provision :shell, :inline => <<-EOT | |
apt-get install -y curl git vim |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" | |
xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:atom="http://www.w3.org/2005/Atom" | |
> | |
<channel> | |
<title>WordPress News</title> | |
<atom:link href="https://wordpress.org/news/feed/" rel="self" type="application/rss+xml" /> | |
<link>https://wordpress.org/news</link> | |
<description>WordPress News</description> |
This file contains hidden or 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
function buildUI() { | |
var tableContainer = document.createElement('div'); | |
tableContainer.style.width = '100%'; | |
tableContainer.style.height = '50px'; | |
tableContainer.style.bottom = '0px'; | |
tableContainer.style.position = 'absolute'; | |
tableContainer.innerHTML = '<table id="timerTable" style="width: 100%; table-layout: fixed;"></table>'; | |
document.body.appendChild(tableContainer); | |
document.getElementById('game').style.marginBottom = '50px'; | |
document.getElementById('footerLinks').style.marginBottom = '60px'; |
This file contains hidden or 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/ruby | |
def capture3(*cmd) | |
# Force no shell expansion, by using a non-plain string. See ruby docs: | |
# | |
# `If the first argument is a two-element array, the first element is the | |
# command to be executed, and the second argument is used as the argv[0] | |
# value, which may show up in process listings.' | |
cmd[0] = [cmd[0], cmd[0]] |
This file contains hidden or 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 | |
dir="$1" | |
cd "$dir" | |
# Add new or changed files | |
git ls-files --exclude-standard -o -m -z | xargs -0r git add | |
# Commit changes, if any | |
if ! git diff --cached --quiet; then |
This file contains hidden or 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/perl | |
use warnings; | |
use v5.12; | |
use File::Basename qw(dirname); | |
use Data::Dumper; | |
sub usage { | |
print <<USAGE; | |
bpc-tar HOST DIR |
This file contains hidden or 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/python3 | |
from math import sqrt, log | |
from sys import argv | |
N = int(argv[1]) | |
primes = list() | |
for i in range(2, int(sqrt(N + 1))): | |
if not any(i % p == 0 for p in primes): | |
primes.append(i) |
This file contains hidden or 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
test4 |
OlderNewer