Skip to content

Instantly share code, notes, and snippets.

@stardines
stardines / mithril-touch.js
Last active August 29, 2015 14:27 — forked from webcss/mithril-touch.js
mithril-touch, consume touch and mouse events evenly with mithril
/*****************************************
/* DOM touch support module
/*****************************************/
if (!window.CustomEvent) {
window.CustomEvent = function (event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
@stardines
stardines / has3d.js
Created September 23, 2015 14:06 — forked from lorenzopolidori/has3d.js
Testing for CSS 3D Transforms Support
function has3d(){
if (!window.getComputedStyle) {
return false;
}
var el = document.createElement('p'),
has3d,
transforms = {
'webkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
@stardines
stardines / mac-commands.md
Created January 31, 2018 11:23
useful CMD commands

//To remove .orig files generated by repository $find . -iname '*.orig' -exec rm '{}' ';'

@stardines
stardines / chartjs-showAllTooltips-helper.js
Created February 15, 2018 11:05
chartjs all tooltips helper
Chart.pluginService.register({
beforeRender: function (chart) {
if (chart.config.options.showAllTooltips) {
// create an array of tooltips
// we can't use the chart tooltip because there is only one tooltip per chart
chart.pluginTooltips = [];
chart.config.data.datasets.forEach(function (dataset, i) {
chart.getDatasetMeta(i).data.forEach(function (sector, j) {
chart.pluginTooltips.push(new Chart.Tooltip({
_chart: chart.chart,