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
<!-- | |
mysql query to generate option list | |
SELECT CONCAT('<option value="', `Name`, '">', `Name`, '</option>') FROM mysql.time_zone_name; | |
if mysql.time_zone_name has no records go here: http://dev.mysql.com/downloads/timezones.html | |
to convert date/time between timezones do something like this: | |
SELECT startdate, CONVERT_TZ(startdate, 'utc', (SELECT timezone FROM accounts WHERE id=1)) FROM auctions; | |
This query takes two values, one on daylight savings and one off daylight savings, and converts them to a daylight savings impacted time zone: |
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
mysqldump -u [username] -p [schema] > filename_yyyy.mm.dd.sql | |
mysql -u [username] -p [schema] < filename_yyyy.mm.dd.sql | |
-- You will be prompted to provide the password each time |
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
-- You will be prompted for a password as necessary | |
mysqldump -u [username] -p [schema] --no-data > schema.sql |
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; | |
# input file taken from: | |
# http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | |
my %extensions; | |
my $input = "./mimetypes.txt"; | |
my $output = "./contenttypes.txt"; |
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; | |
#----------------------------------------------------------------------------------# | |
# Run from the command line. This will first parse the Apache mime.types file from # | |
# here (http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types), # | |
# and then the dictionary portion only of this (http://stackoverflow.com/a/7161265)# | |
# StackOverflow answer (starting on the fifth line down), saved as mime.dict. All # | |
# files are expected to be in the same directory. # |
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
using System; | |
using System.Text.RegularExpressions; | |
namespace YourNamespace | |
{ | |
public static class StringExtensions | |
{ | |
public static string Capitalize(this String s) | |
{ | |
if (!String.IsNullOrEmpty(s)) |
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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using Grapevine; | |
using Newtonsoft.Json.Linq; | |
namespace YourNameSpace | |
{ | |
class ExtendedRestServer |
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
use Scalar::Util ('blessed'); | |
###############################| Declassify |############################### | |
sub Declassify | |
{ | |
my @params = @_; | |
shift (@params) if ($params[0] eq __PACKAGE__); | |
my @args = (ref $params[0] eq 'ARRAY') ? @{$params[0]} : (); | |
my $pkg = $params[1] || __PACKAGE__; |
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class CommandLine | |
{ | |
private static final BufferedReader input; | |
static | |
{ | |
input = new BufferedReader(new InputStreamReader(System.in)); |
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
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Layers</title> | |
<style type="text/css"> | |
#loading, #loaded | |
{ | |
position: fixed; |
OlderNewer