Skip to content

Instantly share code, notes, and snippets.

View bardware's full-sized avatar

Bernhard Döbler bardware

View GitHub Profile
@rc1
rc1 / otf2ttf2eot.sh
Created April 9, 2013 14:49
Converts OpenType fonts file to an Embedded OpenType file on the Mac. Tools installed via homebrew on Mac.
#!/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 '
@tonyjunkes
tonyjunkes / .htaccess
Created June 26, 2013 01:25
Apache Mod_Rewrite .htaccess example to rewrite a FW/1 Subsystem URL to be SES and rewrite to remove index.cfm from URLs. Replace the example Subsystem (admin) with the actual Subsystem to be rewritten.
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]
@JamoCA
JamoCA / CSVtoQuery.cfm
Last active April 13, 2018 14:52
Convert CSV File to Coldfusion Query Object using ColdFusion & opencsv (Java)
<!---
Convert CSV file to a ColdFusion query object using opencsv.
Requirements:
- ColdFusion 8+ ( http://en.wikipedia.org/wiki/Adobe_ColdFusion )
- opencsv - free parser library for Java ( http://opencsv.sourceforge.net/ )
http://opencsv.sourceforge.net/
opencsv supports all the basic csv-type things you're likely to want to do:
- Arbitrary numbers of values per line
- Ignoring commas in quoted elements
- Handling quoted entries with embedded carriage returns (ie entries that span multiple lines)
@smoser
smoser / ubuntu-cloud-virtualbox.sh
Last active April 2, 2024 21:07
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 2, 2024 23:15
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@bennadel
bennadel / java-cast-arrays.cfm
Created October 9, 2013 13:07
Creating Typed Java Arrays In ColdFusion Using JavaCast()
<cfscript>
// Byte arrays. Binary data is represented by an array of bytes.
// And, each byte is represented by an integer. For simple values,
// we don't have to manually cast each value - we can just pass-in
// the array and ColdFusion will perform the cast.
// Test 1 - Spell "SARAH" with ColdFusion numbers.
bytes = javaCast(
@davidpett
davidpett / filesize_helper.js
Created October 31, 2013 22:17
filesize handlebars helper
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];
<cfparam name="url.x" default="1;delete from x">
<cfset esapi = CreateObject("java", "org.owasp.esapi.ESAPI").encoder()>
<cfset codec = createObject("java","org.owasp.esapi.codecs.MySQLCodec").init(0)>
<cfset url.x = esapi.encodeForSQL(codec, url.x)>
<cfquery name="q" datasource="amex">
select * from [users]
where id like #url.x#
</cfquery>
<cfdump var="#q#" />
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@spartDev
spartDev / gulpfile.js
Last active March 15, 2020 14:09
Gulp config
/*---------- Declare gulp variables ----------*/
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
csslint = require('gulp-csslint'),
compass = require('gulp-compass'),
connect = require('gulp-connect'), path = require('path'),
livereload = require('gulp-livereload'),
clean = require('gulp-clean'),