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> | |
<div style="display: flex; flex-flow: column; height: 400px; width: 300px; border: 1px solid green"> | |
<div style="padding: 20px; background-color: teal; color: white;"> This is some sort of heading</div> | |
<div style="border: 1px solid red; overflow: auto;"> | |
this is the body | |
<br> | |
this is the body | |
<br> | |
this is the body | |
<br> |
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> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/preact/8.2.7/preact.dev.js"></script> | |
<div id="app"></div> | |
<script> | |
var app = { | |
color: "#00ffff", | |
} | |
function changeColor(e) { |
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> | |
<div id=app> | |
<my-button text=Hello :myonclick="() => foo('yo')" @mymouseenter=foo2></my-button> | |
</div> | |
<script src="https://unpkg.com/vue/dist/vue.min.js"></script> | |
<script> | |
Vue.component('my-button', { | |
props: ['text', 'myonclick'], | |
template: '<button type="button" class="btn" @click="myonclick" @mouseenter="doMouseEnter">{{ text }}</button>', | |
methods: { |
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
https://github.com/drewlesueur/php-src/tree/7568605b55189cbc5fedd6dff3da074f9abf1d6d |
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> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div style="height: 400px; border: 1px solid green; width: 300px; display: flex; flex-flow: column nowrap; "> | |
<div style="padding: 20px; background-color: orange; ">I am a header</div> | |
<div style="flex: 1 1 auto; display: flex; flex-flow: column nowrap; overflow: auto;"> |
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 scale(x, realMin, realMax, scaledMin, scaledMax) { | |
var realDiff = realMax - realMin | |
var scaledDiff = scaledMax - scaledMin | |
var xOffset = x - realMin | |
var ratio = xOffset / realDiff | |
var appliedValue = ratio * scaledDiff | |
var ret = scaledMin + appliedValue | |
return ret | |
} |
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 ifs = function (args, i) { | |
var i = i || 0; | |
if (i == args.length - 1) { return args[i] } | |
else if (i > args.length - 1) { return undefined } | |
if (args[i]) { return args[i + 1] } | |
else { return ifs(args, i + 2) } | |
} |
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 a = {name: "a", fun: function () { return this; }}; | |
console.log(a.fun()); | |
//=> {name "a", fun: ...} | |
var bFunc = function () { return this }; | |
var b = {name: "b", fun: bFunc}; | |
console.log(b.fun()); | |
//=> {name: "b", fun: ...} | |
// not some global object |
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
// alternate to imagecreatefrom... | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); | |
$image = curl_exec($ch); | |
curl_close($ch); |
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
// code taken from visionmedias node-querystring | |
var qs = (function () { | |
var qs = {} | |
/** | |
* Object#toString() ref for stringify(). | |
*/ | |
var toString = Object.prototype.toString; | |
/** |
NewerOlder