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
import React from "react"; | |
class RadioGroup extends React.Component{ | |
constructor(props){ | |
super(props); | |
this.handleCheckboxChange = this.handleCheckboxChange.bind(this); | |
this.state = { selectedOption : this.props.checked } | |
} |
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 getBase64Image(img) { | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
var ctx = canvas.getContext("2d"); | |
ctx.drawImage(img, 0, 0); | |
var dataURL = canvas.toDataURL("image/png"); | |
return dataURL.replace(/^data:image\/(png|jpg);base64,/, ""); | |
} |
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
const states = this.state.proposalOptions; | |
let gathered = {}; | |
Object.keys(states).map((key)=>{ | |
gathered[key] = this.state.proposalOptions[key]; | |
} | |
); |
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
let scroller=(callback, interval)=>{ | |
//Inits the var | |
let scrollStop; | |
//Adds the event listener | |
window.addEventListener('scroll', function () { | |
clearTimeout(scrollStop); | |
scrollStop = setTimeout(function () { | |
//Execute the callback passed as reference |
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 convertJsonToObjAttributes($json){ | |
$keys = array_keys((array)$json); | |
$jsonSize = count($json); | |
for( $i=0; $i<$jsonSize; $i++ ) | |
$this->{$keys[$i]} = $json[$keys[$i]]; | |
} |
NewerOlder