Skip to content

Instantly share code, notes, and snippets.

interface IntrinsicElements {
// HTML
a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
abbr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
address: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
area: React.DetailedHTMLProps<React.AreaHTMLAttributes<HTMLAreaElement>, HTMLAreaElement>;
article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
b: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
const crypto = require('crypto');
const queryString = require('query-string');
const urlencode = require('urlencode');
const rp = require('request-promise');
const method = 'GET';
const url = 'http://platform.fatsecret.com/rest/server.api';
const params = {
method: 'foods.search',
format: 'json',
@imcodetolive
imcodetolive / LICENSE.txt
Created October 3, 2017 17:42 — forked from jed/LICENSE.txt
use anchor tags to parse URLs into components
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Create a global Event Bus
var EventBus = new Vue()
// Add to Vue properties by exposing a getter for $bus
Object.defineProperties(Vue.prototype, {
$bus: {
get: function () {
return EventBus;
}
}
function modify(modifiers) {
return through2.obj(function(file, encoding, done) {
var stream = this;
function applyModifiers(content) {
(typeof modifiers === 'function' ? [modifiers] : modifiers).forEach(function(modifier) {
content = modifier(content, file);
});
@imcodetolive
imcodetolive / constrain.js
Created September 4, 2014 18:14
Constrain a number between two bounds
define(function(){
"use strict";
var constrain;
constrain = function(min, max){
return function(number){
return Math.max(min, Math.min(number, max));
};
};
@imcodetolive
imcodetolive / parseURLParams.js
Created September 4, 2014 17:45
Convert URL parameters to a javascript object
define(function(){
"use strict";
var parseURLParams;
parseURLParams = function(str){
var obj;
obj = {};
/**
* Placeholder
* @author Diego Oliveira <[email protected]>
*/
;(function(){
var _private = {},
methods = {};
_private = {
onblur : function(force){
// Use before yours CSS files
document.documentElement.className = document.documentElement.className.replace(/(\s*|^)no-js(\s*|$)/, "$1js$2");