Skip to content

Instantly share code, notes, and snippets.

View edbo's full-sized avatar

Ed Bosher edbo

View GitHub Profile
@edbo
edbo / line_replace
Created October 7, 2013 06:48
Replace linebreaks with feed characters using sed
%s/\n/\\n/
@edbo
edbo / test.js
Created February 10, 2012 03:12
HKJC Mobile
function hidePage(){
$('#mainContainer').hide();
$('#seo').hide();
$('#footer').hide();
$("#overlay-item").show();
$("#overlay-bg").show();
}
function showPage(){
$('#mainContainer').show();
@edbo
edbo / lexiconToCsv.php
Created January 25, 2012 08:16
Php snippet to output lexicon file to csv
<%php
$fp = fopen('file.csv', 'w');
foreach ($_lang as $key => $field) {
fputcsv($fp, array(
'key' => $key,
'field' => $field
));
}
fclose($fp);
@edbo
edbo / config.inc.php
Created January 19, 2012 02:58
MODX Config File
<?php
/**
* MODX Configuration file
*/
$database_type = 'mysql';
$database_server = '#DBHOST#';
$database_user = '#DBUSER#';
$database_password = '#DBPASS#';
$database_connection_charset = 'utf8';
$dbase = '#DBNAME#';
@edbo
edbo / node-https-snippet
Created January 19, 2011 04:42
Snippet demonstrating how to use Node as an https server
var crypto = require('crypto'),
fs = require('fs'),
http = require('http');
var port = 8080;
var privateKey = fs.readFileSync('privatekey.pem').toString(),
certificate = fs.readFileSync('certificate.pem').toString();
var credentials = crypto.createCredentials({key: privateKey, cert: certificate});