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 groovy.util.GroovyTestCase; | |
class TestMan extends GroovyTestCase | |
{ | |
def particleMan = new Man(Man.Type.Particle); | |
def triangleMan = new Man(Man.Type.Triangle); | |
def universeMan = new Man(Man.Type.Universe); | |
def personMan = new Man(Man.Type.Person); | |
void testParticleMan () |
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
-- Using GRANT for creating new users has been deprecated and will be removed in the future | |
-- as of 5.7.1 | |
-- Create a new user | |
create user '[username]'@'[host]' identified by '[password]'; | |
-- Create a new database/user | |
create database [schema]; | |
-- Grant user access to database |
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
using System; | |
using System.Reflection; | |
namespace Grapevine | |
{ | |
public enum ContentType | |
{ | |
[Metadata(Value = "application/x-authorware-bin", IsBinary = true)] | |
AAB, |
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 |
OlderNewer