Skip to content

Instantly share code, notes, and snippets.

View darylf's full-sized avatar
🇨🇦
Senior Software Developer

Daryl Fritz darylf

🇨🇦
Senior Software Developer
View GitHub Profile
@darylf
darylf / cbr2cbz.sh
Last active August 30, 2022 03:25
Basch Script to Convert CBR to CBZ file
#!/bin/sh
FILENAME="$1"
DIR="$(dirname "$FILENAME")"
BASENAME=$(basename "$FILENAME" .cbr)
DIR_TMP="$DIR/tmp"
echo "Converting $FILENAME"
mkdir "$DIR_TMP"
@darylf
darylf / devtools.responsiveUI.presets.json
Created February 12, 2017 20:45
Firefox responsive design view breakpoints
[
{
"key": "800x1280",
"name": "Amazon Kindle Fire HD 8.9",
"width": 800,
"height": 1280
},
{
"key": "480x800",
"name": "Amazon Kindle Fire HD 7",
@darylf
darylf / disapproval.html
Last active August 29, 2015 14:27
Unicode can be used as valid HTML ID's and Classes.
<!doctype html>
<head>
<title>Disapproval</title>
<style>
#ಠ_ಠ { }
.❤ { }
</style>
</head>
<body>
@darylf
darylf / gist:e0a9850b12d7d11cfe34
Created November 4, 2014 20:24
Redundant Much?
TextBox1.Visible = ShowTextBox ? true : false;
// Refactor the below code.
try
{
abc = !String.IsNullOrEmpty(wsResponse.Webservice.AbcValue) ? Convert.ToInt32(wsResponse.Webservice.AbcValue) : 0;
}
catch (Exception ex)
{
//throw it out and it will be handled by the caller
throw ex;
@darylf
darylf / gist:2354060
Created April 10, 2012 19:58
Validate date format in C#
/// <summary>
/// Validate date is a proper format
/// </summary>
/// <param name="date"></param>
/// <returns></returns>
public static bool IsDate(string date)
{
bool valid = true;
//check in 99/99/9999 format
valid = Regex.IsMatch(date, "^[0-9]{2}/[0-9]{2}/[0-9]{4}$");
@darylf
darylf / growl.watchr.rb
Created August 27, 2011 22:01
Combining Watchr, Spork, and Growl for Ruby on Rails testing.
# Combined from:
# [1] http://www.rubyinside.com/how-to-rails-3-and-rspec-2-4336.html
# [2] https://gist.github.com/600976
unless defined?(GROWL)
$stderr.sync=true
$stdout.sync=true
ENV["WATCHR"] = "1"
GROWL=`which growlnotify`.chomp