Skip to content

Instantly share code, notes, and snippets.

Torsten Feld torstenfeld

Block or report user

Report or block torstenfeld

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@torstenfeld
torstenfeld / gist:8368250
Created Jan 11, 2014
socket.io + express
View gist:8368250
var http = require('http');
var express = require('express');
var app = express();
app.use(express.bodyParser());
var server = http.createServer(app);
var io = require('socket.io').listen(server, {});
io.configure(function() {
io.set('log level', 2);
@torstenfeld
torstenfeld / gist:6205523
Created Aug 11, 2013
Handlebars.js if-condition helper
View gist:6205523
Handlebars.registerHelper('ifCond', function(v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
break;
case '!=':
return (v1 != v2) ? options.fn(this) : options.inverse(this);
break;
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
View README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
    • apache's home directory is /var/www/
View config.php
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
@torstenfeld
torstenfeld / post-form-output.js
Created Nov 29, 2012
Output of post parameters with javascript
View post-form-output.js
<script>
$('form').submit(function() { // on submitting the form
alert($(this).serialize()); // alert the parameter string which would be sent
return false; // return false to stop the submit
});
</script>
@torstenfeld
torstenfeld / _sql.au3
Created Oct 8, 2012
AutoIT connect to MsSQL Server
View _sql.au3
#include-once
; #INDEX# ========================================================================
; Title .........: _SQL.au3
; AutoIt Version : 3.2
; Language ......: English
; Description ...: Some SQL stuff to use with an MSDE database
; Author ........: Chris Lambert
; ================================================================================
; #VARIABLES# ====================================================================
View gist:3685383
Func _UpdateCheck(ByRef $lResultArray, $lNoUpdateMessage) ; checks for new versions of tool and ini files
Local $lTempArray, $lVar, $Var2, $lForceUpdate, $lIndex
Local $lUpdateItemsArray
Local $lCaseToCheckFor = "tool"
Local $lInetReadResult = InetRead($gUpdateInformation, 7)
If @error Then
_WriteDebug('ERR ;_UpdateCheck;Could not read "' & $gUpdateInformation & '"')
Return SetError(1, 0, 0)
You can’t perform that action at this time.