Skip to content

Instantly share code, notes, and snippets.

Robert Wildling rowild

  • Vienna
Block or report user

Report or block rowild

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
@rowild
rowild / install_gui_application_darwin.sh
Created Jul 15, 2018 — forked from lambdalisue/install_gui_application_darwin.sh
Install Mac OS X Gui Application via Homebrew Cask
View install_gui_application_darwin.sh
#!/usr/bin/env bash
#==============================================================================
# Install Mac OS X GUI Application via brew cask
#==============================================================================
brew cask install google-chrome
brew cask install thunderbird
brew cask install dropbox
brew cask install copy
brew cask install slack
brew cask install the-unarchiver
View js-array__better-handling-of-contain.js
var ALEX = ['foo', 'bar'];
//n00bs write:
if (ALEX.indexOf('foo') > -1) {
//ALEX contains foo
}
//pros write:
if (~ALEX.indexOf('foo')) {
//ALEX contains foo
@rowild
rowild / gist:3d6072d02287125d7ade
Created Feb 24, 2016 — forked from talltyler/gist:5345894
This code gives the HTML canvas element JavaScript support for letter spacing. Don't confuse letter spacing with kerning http://en.wikipedia.org/wiki/Kerning This code is basically from http://stackoverflow.com/a/15509006
View gist:3d6072d02287125d7ade
(function(){
var _fillText,
__slice = [].slice;
_fillText = CanvasRenderingContext2D.prototype.fillText;
CanvasRenderingContext2D.prototype.fillText = function() {
var args, offset, previousLetter, str, x, y,
_this = this;
@rowild
rowild / Web Audio API - Sound Fading
Created Oct 27, 2015 — forked from ichabodcole/Web Audio API - Sound Fading
Reference for fading in and out sounds with the Web Audio API
View Web Audio API - Sound Fading
fadeTo: (value, fadeLength)->
fadeLength = fadeLength || @defaultfadeLength
currentTime = @ctx.currentTime
#time the fade should complete
fadeTime = currentTime + fadeLength
#set the start time
@masterGain.gain.setValueAtTime(@userVolume, currentTime)
@masterGain.gain.linearRampToValueAtTime(value, fadeTime)
fadeOut: (fadeLength)->
@rowild
rowild / Local Fallback for jQuery and Modernizr
Created Oct 16, 2015 — forked from benjamincharity/Local Fallback for jQuery and Modernizr
Include jQuery and Modernizr from a CDN and add local fallbacks in case the CDN fails. Versions written in HTML and HAML.
View Local Fallback for jQuery and Modernizr
HTML
=====
<script type='text/javascript'>
window.jQuery || document.write('<script src="js/jquery-1.7.1.js">\x3C/script>')
</script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js' type='text/javascript'></script>
<script type='text/javascript'>
window.Modernizr || document.write('<script src="js/modernizr-2.0.6.js">\x3C/script>')
</script>
@rowild
rowild / flatten.php
Last active Aug 30, 2015 — forked from kohnmd/flatten.php
Function to recursively flatten multidimensional PHP array.
View flatten.php
<?php
// Requires PHP 5.3+
// Found here: http://stackoverflow.com/a/1320156
function flatten_array(array $array) {
$flattened_array = array();
array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; });
return $flattened_array;
}
@rowild
rowild / Install_latest_xdebug_for_MAMP.md
Last active Aug 29, 2015
Install latest XDebug for MAMP php versions
View Install_latest_xdebug_for_MAMP.md

Install latest XDebug for MAMP php

The installation of XDebug requires some additional steps to make it work:

  1. Change the local bash files to address the MAMP version of php.
  2. Download the same version of php that you want to use within MAMP from php.net and build it manually.
  3. Download XDebug and follow the installation instructions as provided by the XDebug website.

Step-by-step guide:

1. Adjust the bash files to address the MAMP php version

@rowild
rowild / typo3_felogin_redirect_to_previousely_visited_page.php
Last active Aug 29, 2015
TYPO3 - felogin -> redirect to previousely visited page
View typo3_felogin_redirect_to_previousely_visited_page.php
<?php
// From: Newslist en - 25.4.2014
// http://wiki.typo3.org/Felogin#Users_manual
// Add this line in my ext_localconf:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'][] = 'tx_myextension->myfunction';
// And in my class extension:
class tx_myextension extends {
public function myfunction() {
View stylus-mixins_for_generating_rem_based_css.styl
/************************
* Vars
***********************/
// standard default browser font size is 16px
$base_font_size = 16
// bring the base font size upto 18px while respecting the client's individual browser setting
$base_font_size_ems = unit($base_font_size / 16, em)
@rowild
rowild / css_image_replacement_expl.css
Last active Dec 16, 2015
CSS: Image Replacement
View css_image_replacement_expl.css
/* Text hiding without indent */
.ir {
border: 0;
font: 0/0 a;
text-shadow:none;
color: transparent;
background-color: transparent;
}
You can’t perform that action at this time.