This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function copy(d:DisplayObject, w:Number, h:Number, smoothing : Boolean = true): Bitmap | |
{ | |
var data:BitmapData = new BitmapData(w, h, true, 0xffffff); | |
var bmp:Bitmap = new Bitmap(data); | |
bmp.smoothing = smoothing; | |
bmp.bitmapData.draw(d); | |
return bmp; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this: | |
context.clearRect(0, 0, width, height); | |
// or: | |
canvas.width = canvas.width; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isCreditCard(CC) { | |
if (CC.length > 19) | |
return (false); | |
var sum = 0; var mul = 1; var l = CC.length; var digit; var tproduct; | |
for (var i = 0; i < l; i++) { | |
digit = CC.substring(l - i - 1, l - i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var main = function() { | |
var _index; | |
function iterate() { | |
console.log(_index); | |
if (_index > 1) | |
setTimeout(iterate, 1000); | |
_index--; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//functional | |
function logCar(object) { | |
this.color = object.color; | |
this.make = object.make | |
console.log('I\'m a ' + this.color + ' ' + this.make); | |
} | |
// object-oriented | |
(function(window){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dates = [{ | |
date : 'Feb 5 1924', | |
animal : 'Rat' | |
}, | |
{ | |
date : 'Jan 24 1925', | |
animal : 'Ox' | |
}, | |
{ | |
date : 'Feb 13 1926', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
div { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-07-16T16:43:35.573Z","extensionVersion":"v3.4.0"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* withData HOC - loads any data as Promise.all, shows loading icon and passes data along via props to children | |
*/ | |
import React, { Component } from 'react'; | |
import { Loading } from 'carbon-components-react'; | |
import ErrorModal from '../ErrorModal/ErrorModal'; | |
import RequestUtils from '../../utilities/RequestUtils'; | |
/** |
OlderNewer