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/bash | |
for key in "$@" | |
do | |
key="$1" | |
flipSubs=false | |
tenbit=false | |
case $key in |
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
/// Calculates the size of a rectangle that fits within the confines of another | |
/// rectangle the size of the dimensions described by [outer] with the same | |
/// aspect ratio as the rectangle described by [inner]. | |
Point fitWithin(Point inner, Point outer) { | |
final double outerRatio = outer.x/outer.y; | |
final double innerRatio = inner.x/ inner.y; | |
if(outerRatio<innerRatio) { | |
final num x = outer.x; | |
final num y = inner.y * (outer.x/inner.x); |
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
FileChooserDialog fcd = new FileChooserDialog ("Choose files",this, FileChooserAction.Open, | |
"Select", ResponseType.Ok, "Cancel", ResponseType.Close); | |
fcd.SelectMultiple = true; | |
fcd.Run (); // This opens the window and waits for the response | |
fcd.Destroy (); // The dialog does not automatically close when clicking the buttons, so you have to manually close it with this |
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
private void ResizeListViewHeight(ListView lv) { | |
IListAdapter la = lv.Adapter; | |
if (la == null) { | |
return; | |
} | |
int totalHeight = 0; | |
DisplayMetrics dm = new DisplayMetrics(); |
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
GIMP Palette | |
Name: Google Colors | |
Columns: 3 | |
# Created by Matthew Barbour | |
# Based on Google colour guidelines from http://www.behance.net/gallery/Google-Visual-Assets-Guidelines-Part-1/9028077 | |
66 133 244 Blue 1 | |
118 167 250 Blue 2 | |
160 195 255 Blue 3 | |
219 68 55 Red 1 | |
229 115 104 Red 2 |
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 convertToDni(number) { | |
var new_number = new Array(); | |
// If the number is just 0, then we just save some time and output a zero | |
if(number==0) { | |
new_number.unshift(0); | |
return new_number; | |
} | |
// D'Ni is base-25, so we divide by 25 over and over again, depositing the remainders into the new number, | |
// until the number is finally less than 25 (meaning dividing it by 25 floors to 0 | |
while(number>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
#!/usr/bin/perl | |
use Data::Dumper; | |
sub GetIpAddresses{ | |
my $output = qx(ifconfig); | |
my $hash = {}; | |
my $interface; | |
foreach my $line (split /[\r\n]+/, $output) { | |
if($line =~ m/^([^ ]+)/) { |
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
<html> | |
<head> | |
<script> | |
function process() { | |
var element = document.getElementById("input"); | |
var input = element.value; | |
var data = new Array(); | |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
var filesystems=<?php | |
$filesystems = array(); | |
$header_regex = "|^([A-Za-z0-9/]+)\s+([a-z]+)\s+([^\s]+)\s+([a-z-]+)$|"; | |
$output = array(); |
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
Private Function PrintDataSetToHTML(ByRef ds As DataSet) As String | |
Dim output As New StringBuilder | |
For Each dt As DataTable In ds.Tables | |
output.AppendLine("<table>") | |
output.Append("<caption>") | |
output.Append(dt.TableName) | |
output.AppendLine("</caption>") | |
output.AppendLine("<tr>") | |
For Each dc As DataColumn In dt.Columns | |
output.Append("<th>") |
NewerOlder