Skip to content

Instantly share code, notes, and snippets.

var head = [
  {
      cols: [
          {
              sortId: 'column_1', // make column clicable and sortable
              text: 'Column Name 1' // text in column
          },
          {
              sortId: 'column_2', // make column clicable and sortable
var glob = require("glob");
var fs = require("fs");
var browserify = require("browserify");
var babelPresetEs2015 = require('babel-preset-es2015');
var babelPresetReact = require('babel-preset-react');
// Global Sources or Compiled Assets Destination Paths
var BUILD_ASSETS_PATH = '../www/assets-v2';
var NODE_MODULES_PATH = './node_modules';
var GLOBAL_SCSS_PATH = './scss';

Routes namespace: /seo-tools/admin/social-platforms/api/location/{LOCATION_ID}/

Auth

  1. Open link .../auth/(facebook|twitter) in child window
  2. 301 Redirect to OAuth service with Callback URL .../auth/callback
  3. Authed in OAuth service and redirected to Callback URL
  4. Callback URL page make JS call to parent window to switch UI into authed mode

Auth (facebook only)

@jmas
jmas / animations.css
Created April 17, 2016 22:32
SVG2CSS : output files
@keyframes dropball {
0% {
bottom: 200px;
}
2% {
bottom: 198.89046144485474px;
}
4% {
bottom: 197.5577425956726px;
}
const WIN_WIDTH = 500;
const WIN_HEIGHT = 600;
function watchForWindowClose (win, callback) {
if (! win.closed) {
return setTimeout(() => {
watchForWindowClose(win, callback);
}, 1000);
}
callback();
@jmas
jmas / object-to-form-data.js
Created May 15, 2016 08:19 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@jmas
jmas / cli.php
Created May 17, 2016 22:04
Slim Framework 3 as cli command
<?php
// php cli.php /update
require __DIR__ . '/vendor/autoload.php';
if (PHP_SAPI == 'cli') {
$argv = $GLOBALS['argv'];
array_shift($argv);
@jmas
jmas / Arduino 230v Light bulb dimming
Created May 22, 2016 21:50 — forked from ryanamaral/Arduino 230v Light bulb dimming
Arduino 230v Light Bulb Dimming (Portugal 220V 50 Hz)
//source: http://electronics.stackexchange.com/q/59615
int AC_LOAD = 3; // Output to Opto Triac pin
int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF
void setup()
{
pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output
attachInterrupt(0, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
}
@jmas
jmas / dom-diff-test.js
Last active August 30, 2016 23:53
DOM diff libraries test
// Uncomment only when you use it in test:
// import * as diffhtml from 'diffhtml';
// import morphdom from 'morphdom';
// You need a document with <div id="root"></div>
var rootEl = document.getElementById('root');
// Replace with big real HTML pice.
var tpl = `<div>Replace with real big HTML pice.</div>`;
@jmas
jmas / index.html
Last active August 31, 2016 11:18
index.html
<div id="root"></div>