Skip to content

Instantly share code, notes, and snippets.

View frostney's full-sized avatar
🐢

Johannes Stein frostney

🐢
View GitHub Profile
@frostney
frostney / gist:4114006
Created November 19, 2012 21:19
HTML5 Boilerplate plugins.js in Coffeescript
do ->
noop = ->
methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn']
console = (window.console or= {})
@frostney
frostney / Utils.hx
Created October 27, 2012 18:56
jQuery-like extend and each functions for HaXe
package ;
class Utils
{
public static function extend(obj1: Dynamic, obj2: Dynamic): Dynamic {
var keys = Reflect.fields(obj2);
for (k in keys) {
@frostney
frostney / index.html
Created June 18, 2012 20:17
Proof-of-concept for an iOS-like slider ui element in CSS3 with pseudo-selector to be used in a single div element. Works only in Webkit browsers. Demo here: http://jsfiddle.net/Stoney/Xsx9W/
<!doctype html>
<html>
<head>
<title>CSS Magic</title>
<style>
.switch:before, .switch.off:before {
content: "";
@frostney
frostney / gist:2638923
Created May 8, 2012 20:09
jQuery-like each function for node.js
function each(object, callback) {
Object.keys(object).forEach(function(key) {
var value = object[key];
callback(key, value);
});
}
@frostney
frostney / gist:2561433
Created April 30, 2012 19:05
Small jQuery plugin for using CSS3 properties with vendor prefixes. Also includes functions for scaling and rotating.
(function($) {
var vendorPrefix = ['webkit', 'o', 'ms', 'moz'];
$.fn.vendorProperty = function(property, argument) {
var self = this;
self.css(property, argument);
$.each(vendorPrefix, function(index, value) {
self.css('-' + value + '-' + property, argument);
@frostney
frostney / less-1.3.0.js
Created March 14, 2012 22:28
Less 1.3.0 with being always set to production mode
//
// LESS - Leaner CSS v1.3.0
// http://lesscss.org
//
// Copyright (c) 2009-2011, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
(function (window, undefined) {
//
// Stub out `require` in the browser
@frostney
frostney / cmdtest.pas
Created September 10, 2011 18:11
Converts the output of the command line to a string list without the use of pipes or processes. This should work on all unixoid systems.
program cmdtest;
uses
Unix,
Classes,
SysUtils;
function CmdToString(Command: AnsiString): TStringList;
var
formattedDateTime: AnsiString = '';
@frostney
frostney / dglOpenGL.pas
Created June 24, 2011 02:38
Changes to get dglOpenGL.pas (www.delphigl.com) OpenGL 4.1 header working on Mac OS X
(*
Open dglOpenGL.pas in your favorite text editor and change the following lines
*)
// Don't worry about having absolute filepaths. Mac OS X always installs the OpenGL framework with every
// clean installation of Mac OS X and the dylibs are ALWAYS in that path. (Tested on several Mac OS X
// machines including PowerMac G5 with Leopard, MacBook with Snow Leopard, MacBook Pro with Snow Leopard and Lion)
// While the standard search directory for libraries is /usr/lib on Mac OS X as well, you should not use this
// for developing your application as other Mac users don't have the OpenGL libraries in that folder and your
@frostney
frostney / SDL_uikitview.m
Created June 12, 2011 10:39
Add a simple function in SDL iOS 1.3 to detect whether the current target is an iPhone or an iPad
/*
Add this little function to a .m file of your choice. I chose SDL_uikitview.m as it already has the iPhone specific keyboard functions in it.
I'm pretty sure you can choose any *.m file in /Library Source/video/uikit from the Xcode project file.
Make sure this function is added after @implementation ... @end.
*/
int
SDL_iPhoneIsDevicePad(void)
@frostney
frostney / myApplication.pas
Created May 31, 2011 16:08
Elysion - Custom template (If you don't want or need to use the default template shipped with Elysion)
(*
Elysion Custom Template
Compile with: fpc -Mdelphi myApplication.pas
Make sure the Elysion library source are added to the search paths of the compiler for example by compiling with fpc -Mdelphi -Fu./path/to/Elysion -Fi./path/to/Elysion myApplication.pas
(Created by Johannes Stein, 2011. This source code file is PUBLIC DOMAIN.)
*)
program myApplication;