This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mockup of a mixin to usee along the Web Font Loader. | |
// Per font, you hardcode a mixin (can be optimized, go ahead!). In the mixin, the default font is something like Times or Arial. By fiddling a bit later on, you can determine the optical ratio between the rendered height of your font, and the fallback. | |
// Put that on the place of the 0.95. | |
// When the WFL finishes loading, it will set a class on the root element. Because you have selected a version of the font, for example a bold or italic one, you have to re-set all the font options related to that. Otherwise you will get a fake bold. | |
// So, while the font is loading (can take 2-5 seconds on slow, mobile connections, but also on desktop!) you will see the fallback font, instead of a void for all places your font is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new_filename(num, filename) | |
if num.to_i < 9 | |
"_0#{num.to_i+1}#{filename}" | |
elsif num.to_i < 99 | |
"_#{num.to_i+1}#{filename}" | |
else | |
"#{num.to_i+1}#{filename}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper to specify ALL CSS to make sure it won't get overwritten on the 'host' site. | |
*/ | |
class WidgetCssHelper extends AppHelper { | |
/** | |
* @param $styles Array with the style of the element | |
* @param bool $noDefaults boolean, must the default css be loaded? | |
* @return string Css with the css rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var forUserFunctions = (function(window, document) { | |
var privateElm = document.getElementById('supersekrit'); | |
function setNewText(newText) { | |
privateElm.innerHTML = newText; | |
} | |
function capitalize() { | |
privateElm.innerHTML = privateElm.innerHTML.toUpperCase(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function route_url($segments, $slash = true) { | |
$CI =& get_instance(); | |
$routes = $CI->router->routes; | |
$toReturn = false; | |
foreach ($routes as $route => $arch) { |