Skip to content

Instantly share code, notes, and snippets.

View griiettner's full-sized avatar

Paulo Griiettner griiettner

View GitHub Profile
@griiettner
griiettner / build.js
Last active April 27, 2022 21:45
Snippet for Style Dictionary where it generate SCSS maps like in Bootstrap variables
const StyleDictionary = require('style-dictionary');
const { fileHeader } = StyleDictionary.formatHelpers;
const styleDictionary = StyleDictionary.extend({
source: [`src/tokens/**/*.json`],
platforms: {
scss: {
transformGroup: `scss`,
Verifying my Blockstack ID is secured with the address 1CVLoB54t1roxMv2hCjwAUEyh32uMq3bTb https://explorer.blockstack.org/address/1CVLoB54t1roxMv2hCjwAUEyh32uMq3bTb
@griiettner
griiettner / user.keymap
Last active August 4, 2016 22:06 — forked from tonsky/user.keymap
LightTable keymap of Sublime shortcuts
[
[:app "cmd-k-cmd-b" :workspace.show]
[:app "ctrl-`" :toggle-console]
[:editor "alt-w" :editor.watch.watch-selection]
[:editor "alt-shift-w" :editor.watch.unwatch]
[:editor "pmeta-/" :toggle-comment-selection]
[:editor "pmeta-/" :toggle-comment-selection]
[:editor "ctrl-shift-up" :editor.sublime.selectLinesUpward]
[:editor "ctrl-shift-down" :editor.sublime.selectLinesDownward]
[:editor "pmeta-d" :editor.sublime.selectNextOccurrence]
@griiettner
griiettner / hide-system-message-container.php
Last active November 1, 2017 14:11
Hide system-message-container from Joomla template output
<?php $app = JFactory::getApplication(); ?>
<?php if(count($app->getMessageQueue())) : ?>
<jdoc:include type="message" />
<?php endif; ?>
@griiettner
griiettner / gist:09f4149131fc17675158
Created January 27, 2015 16:12
WebApp Home screen metas
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
Reference:
http://stackoverflow.com/questions/8195741/how-do-they-do-this-mobile-site-added-to-homescreen-appears-as-standalone-app
@griiettner
griiettner / gist:bf9c83b5a222a005c63e
Created January 26, 2015 18:44
Hide iPad keyboard Angular version
$scope.hideKeyboard = function() {
document.activeElement.blur();
var inputs = document.querySelectorAll('input');
for(var i=0; i < inputs.length; i++) {
inputs[i].blur();
}
};
// Thanks to:
// http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@griiettner
griiettner / selected_tab_refresh.js
Created July 31, 2014 18:52
Bootstrap 3: Keep selected tab on page refresh
$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
// store the currently selected tab in the hash value
$("ul.nav-tabs > li > a").on("shown.bs.tab", function (e) {
var id = $(e.target).attr("href").substr(1);
window.location.hash = id;
@griiettner
griiettner / variable_variable.less
Created May 22, 2014 20:13
Complex mixin to turn variables part of another variable name
// Code from Seven Phase Max
// ............................................................
// .for
.for(@i, @n) {.-each(@i)}
.for(@n) when (isnumber(@n)) {.for(1, @n)}
.for(@i, @n) when not (@i = @n) {
.for((@i + (@n - @i) / abs(@n - @i)), @n);
}
// ............................................................
@griiettner
griiettner / css_calc_less.less
Created May 22, 2014 13:34
To use CSS calc on LESS
body { width: calc(~"100% - 250px - 1.5em"); }
// Ref: http://stackoverflow.com/questions/11972084/less-aggressive-compilation-with-css3-calc