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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Custom Error Objects in JavaScript</title> | |
</head> | |
<body> | |
<h1>Custom Error Objects in JavaScript</h1> |
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/sh | |
# Convert an OTF font into TTF an EOT formats. | |
# @source: http://stackoverflow.com/a/2467452/179015 | |
# @note: brew install fontforge | |
# brew install | |
# @usage: sh otf2ttf2eot.sh FontName | |
otfFont="$1.otf" | |
ttfFont="$1.ttf" | |
eotFont="$1.eot" | |
fontforge -c ' |
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
public static class EnumerableExtensions | |
{ | |
public static BlockingCollection<T> CopyToBlockingCollectionAsync<T>(this IEnumerable<T> source) | |
{ | |
var collection = new BlockingCollection<T>(); | |
Task.Factory.StartNew(() => | |
{ | |
foreach (var item in source) | |
{ |
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
Ember.Handlebars.helper('filesize', function(value) { | |
if (typeof value === 'undefined') { | |
return null; | |
} | |
var i, | |
filesize, | |
units = ['B', 'KB', 'MB', 'GB', 'TB']; | |
for (i = 0; i < units.length; i++) { | |
if (value < 1024) { | |
filesize = Math.floor(value) + units[i]; |
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
Application.cfc | |
component extends=framework.one { | |
this.ormenabled = true; | |
this.datasource = "store"; | |
this.ormSettings.dbCreate = "dropcreate"; | |
this.ormSettings.logsql = true; | |
this.ormSettings.dialect = "Oracle10g"; | |
variables.framework.reloadApplicationOnEveryRequest = true; |
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 (var conn = new SqlConnection(@"Data Source=(LocalDb)\v11.0;Initial Catalog=Master;Integrated Security=True")) | |
{ | |
conn.Open(); | |
var cmd = new SqlCommand(); | |
cmd.Connection = conn; | |
cmd.CommandText = string.Format(@" | |
IF EXISTS(SELECT * FROM sys.databases WHERE name='{0}') | |
BEGIN | |
ALTER DATABASE [{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
RewriteEngine On | |
#Rewrite FW/1 Subsystem | |
RewriteRule ^admin/(.*)$ index.cfm/admin:$1 [L] | |
#Rewrite index.cfm | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !^.*\.(bmp|css|gif|htc|html?|ico|jpe?g|js|pdf|png|swf|txt|xml)$ | |
RewriteRule ^(.*)$ index.cfm/$1 [NS] |
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
@link-hover-color: lightblue; //Change this to your needs | |
a{ | |
color: @link-color; | |
&:hover{ | |
color: @link-hover-color; | |
} | |
&:hover, &:focus{ | |
text-decoration: none; | |
} | |
&:visited:not(.btn){ |
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
<h2>Server: <cfoutput>#CGI.SERVER_NAME#</cfoutput></h2> | |
<p> | |
The following ColdFusion DSN's are available on this server: | |
</p> | |
<cfscript> | |
// Instantiate CF Admin API | |
adminObj = createObject("component","cfide.adminapi.administrator"); |
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
<cfscript> | |
adminUser = "admin"; | |
adminPW = "password"; | |
thefile = "/absolute/path/to/file.cfm"; | |
adminObj = createObject("component","cfide.adminapi.administrator"); | |
adminObj.login(adminPW, adminUser); | |
adminRuntime = createObject("component","cfide.adminapi.runtime"); | |
adminRuntime.clearTrustedCache(thefile); | |
</cfscript> |
OlderNewer