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
task depsize { | |
group 'Help' | |
description 'Displays the sizes of all dependencies.' | |
doLast { | |
def size = 0, formatStr = "%,10.2f", out = new StringBuffer() | |
configurations.default.collect{it.length() / (1024 * 1024)}.each{size += it} | |
out << 'Total dependencies size:'.padRight(45) | |
out << "${String.format(formatStr, size)} Mb\n\n" | |
configurations.default.sort{-it.length()}.each { | |
out << "${it.name}".padRight(45) |
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/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
# use Time::HiRes qw/time sleep/; | |
# Since Time::HiRes is not always available, use the syscalls directly: | |
require 'syscall.ph'; | |
use subs qw/time sleep/; | |
sub time { | |
my $tv = pack('q2', 0, 0); |
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/bash | |
unset URL TICKET STUB GROUP CERTHASH LANGSELEN | |
shift | |
while [ "$1" ]; do | |
if [ "$1" == "-ticket" ]; then shift; TICKET=$1; fi | |
if [ "$1" == "-stub" ]; then shift; STUB=$1; fi | |
if [ "$1" == "-group" ]; then shift; GROUP=$1; fi | |
if [ "$1" == "-certhash" ]; then shift; CERTHASH=$1; fi | |
if [ "$1" == "-url" ]; then shift; URL=$1; fi |
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/perl | |
use strict; | |
use warnings; | |
use IO::Socket; | |
# use Time::HiRes qw/time sleep/; | |
# Since Time::HiRes is not always available, use the syscalls directly: | |
require 'syscall.ph'; | |
use subs qw/time sleep/; | |
sub time { | |
my $tv = pack('q2', 0, 0); |
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
// Takes a canvas context2d and draws the SMPTE test color bars on it. | |
function drawSMPTEColorBars(c, x, y, w, h) { | |
c.save(); | |
c.translate(x, y); c.scale(w / 1920, h / 1080); | |
var g = c.createLinearGradient(445, 0, 1680, 0); | |
g.addColorStop(0, '#000000'); | |
g.addColorStop(1, '#ffffff'); | |
c.fillStyle='#000000'; c.fillRect(0, 0, 1920, 1080); | |
c.fillStyle='#666666'; c.fillRect(0, 0, 240, 630); | |
c.fillStyle='#bfbfbf'; c.fillRect(240, 0, 205, 630); |
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 autodeps; | |
### | |
# | |
# Example usage: | |
# | |
# #!/usr/bin/perl | |
# use warnings; | |
# use strict; | |
# |
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
Index: check.t | |
=================================================================== | |
RCS file: /cvs/src/bin/mksh/check.t,v | |
retrieving revision 1.732 | |
diff -u -r1.732 check.t | |
--- check.t 17 May 2016 15:36:56 -0000 1.732 | |
+++ check.t 27 May 2016 01:47:35 -0000 | |
@@ -10032,6 +10032,28 @@ | |
bar | |
baz |
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
url='http://example.com/index.html' | |
# "HEAD" request | |
# (most servers support "HEAD", but some don't) | |
if curl -sfILo/dev/null "$url"; then | |
echo "URL exists" | |
else | |
echo "URL does not exist" | |
fi |
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
Vagrant.configure(2) do |config| | |
# Generate shared docker-host Vagrantfile | |
# (the default hashicorp/boot2docker image doesn't work very well at the moment) | |
env = Vagrant::Environment.new | |
vf_path = env.data_dir.join("docker-virtualbox-host", "Vagrantfile") | |
begin | |
env.lock("docker-provider-virtualbox-hostvm") do | |
vf_path.dirname.mkpath | |
File.open(vf_path, 'w') do |file| |
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
# brew cask install virtualbox | |
brew install docker docker-machine | |
docker-machine create -d virtualbox default | |
# docker-machine start | |
# eval $(docker-machine env) |