Skip to content

Instantly share code, notes, and snippets.

@canvasplay
canvasplay / Readme.md
Created January 29, 2021 13:34
Cordova Setup and Go!

https://cordova.apache.org/ Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.

PREREQUISITES install node https://nodejs.org/download/ Install java https://java.com/es/download/ Install android

@canvasplay
canvasplay / atomic-class-generator.scss
Last active December 28, 2020 11:12
SCSS Atomic Responsive & Variant class generator
@use "sass:map";
$atomic-ns: null; // "u";
$atomic-glue: "-";
$atomic-variant-glue: "\\:";
$atomic-responsive-glue: "\\@";
@mixin generateAtomicClasses($name, $values, $break: null, $variant: null) {
$ns: if($atomic-ns, $atomic-ns + $atomic-glue, "");
$preffix: if($variant, $variant + $atomic-variant-glue, "");
/**
* Extracts params inside curly brackets from endpoint url strings
* @param {String} str
* @returns {String[]}
*/
const extractParams = function(str) {
var result = [],
regexp = /{([^}]+)}/g,
cursorMatch;
while ((cursorMatch = regexp.exec(str))) result.push(cursorMatch[1]);
@canvasplay
canvasplay / ChromebookDevWorkspace.md
Last active October 26, 2019 23:03
Chromebook Dev Workspace
@canvasplay
canvasplay / Gruntfile.js
Created November 22, 2017 07:37
Gruntfile server+sass+jst
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concurrent: {
options: {
logConcurrentOutput: true
@canvasplay
canvasplay / speech2text.js
Last active July 18, 2017 12:57
Automatic video transcription using google APIs
/*
Node modules dependencies
"dependencies": {
"@google-cloud/speech": "^0.9.4",
"@google-cloud/storage": "^1.2.0",
"ffmpeg": "0.0.4",
"fluent-ffmpeg": "^2.1.2"
},
//PROPAGATE VIEWPORT TO TOP MOST PARENT FRAME DOCUMENT (only inside frameset)
(function (win) {
try {
//detects if current window is on a framed context
var isFramedCtx = (win.parent !== win);
//detects if widow has head element
var hasHead = win.document.getElementsByTagName('head').length;