Skip to content

Instantly share code, notes, and snippets.

View weiland's full-sized avatar
🍫
🎓 && 💻 #GitHubDropICE

Pascal Weiland weiland

🍫
🎓 && 💻 #GitHubDropICE
View GitHub Profile
@weiland
weiland / getBrowserPrefix.js
Created September 24, 2014 13:06
Get matching browser prefix for css.
function getBrowserPrefix( propName ) {
var prefixes = ['Moz','Webkit','ms']; // also O and Khtml
for ( var len = prefixes.length; len--; ) {
if( ( prefixes[len] + 'Transform' ) in document.body.style ) {
return '-' + prefixes[len].toLowerCase() + '-' + propName;
}
}
@weiland
weiland / 3dSupport.js
Created September 24, 2014 12:56
check css 3d support
var support3d = 'WebKitCSSMatrix' in window || 'MozPerspective' in document.body.style;
@weiland
weiland / isTouch.js
Created September 24, 2014 12:55
simple touch detection in javascript
var isTouch = 'ontouchstart' in window;
@weiland
weiland / README.md
Last active August 29, 2015 14:06
Quick Static Webserver in Node.js, Python, Ruby, PHP and IIS in case one has to run a server in a local directory.

Static Webserver Collection

@weiland
weiland / livereload.md
Last active August 29, 2015 14:06
Including Livereload without browser extension (e.g. CR9S)

Livereload without browser extension

make sure to install livereload globally on your system! \o/

npm install -g livereload`  

run livereload in your local directory or run a watch script

livereload = require('livereload');  
@weiland
weiland / chayns-debugger.js
Created September 8, 2014 12:10
Chayns Debugger
(function (Chayns, window, undefined) {
'use strict';
var lh = window.location.href;
function chooseOS(c) {
var osList = [
new Chayns.SelectOption('Normal', '', false),
@weiland
weiland / chayns-alert.js
Created September 8, 2014 12:05
Chayns Alert Popup Dialog
(function (module, Chayns, undefined) {
'use strict';
module.alert = function (message, cb) {
var buttons = [new Chayns.PopUpButton('OK', cb)];
Chayns.ShowPopUp(message, "", buttons);
};
})(window.TappProject, Chayns);
@weiland
weiland / chayns-confirm.js
Created September 8, 2014 12:04
Chayns confirm dialog box
(function (module, Chayns, undefined) {
'use strict';
module.confirm = function (question, yesCallback, noCallback) {
question = question || '';
yesCallback = yesCallback || Function.prototype;
noCallback = noCallback || Function.prototype;
@weiland
weiland / GetArticle.cs
Created August 22, 2014 10:31
Receive one article from the DB via C# and SQL Stored Procedure
public Models.ShopArticle GetArticle(int aID)
{
SqlCommand cmd = CreateSQLCommand("spGetShopArticle");
cmd.Parameters.Add(CreateParam("@ArticleID", aID));
var dataTable = Fill(cmd);
var retval = new Models.ShopArticle();
if (dataTable.TDataRows.Count == 0)
{
return retval;
@weiland
weiland / RouteConfig.cs
Created August 7, 2014 13:34
Supports building a REST API with ASP.net MVC 5
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// add this block \o/
routes.MapRoute(
name: "single",
url: "{controller}/{id}",