A penis, made purely with css
A Pen by Michael Katz on CodePen.
// Following an answer I posted to my question here: | |
// http://stackoverflow.com/questions/21856892/node-crypto-aes256-cbc-0x0-padding-example/21858749#21858749 | |
//I'm expecting a utf8 encoded string | |
function customPadding(str, blockSize, padder, format) { | |
str = new Buffer(str,"utf8").toString(format); | |
//1 char = 8bytes | |
var bitLength = str.length*8; |
// a string interpolator, extending the String object, | |
// returns a new string with the values in the curly braces replaced | |
// with the ones provided by a passed object. | |
String.prototype.interpolate = function(obj) { | |
var buf = this; | |
for(x in obj) { | |
var re = new RegExp("{"+x+"}","g"); | |
buf = buf.replace("{"+x+"}", obj[x]); | |
} |
// sometimes it easier to select something constant rather than amorphic | |
// the following function allows the inversion of such regular expression | |
// while returning an array of the inverted matched results | |
//<regex> | object - the desired regular expression | |
//<str> | string - the string on which the manipulation will occur | |
//<clear> | boolean - whether should the return array be emptied out of empty cells: ["",1,2,""] -> [1,2] | |
function invertRegex(str, regex, clear) { | |
var arr = str.split(regex); |
A penis, made purely with css
A Pen by Michael Katz on CodePen.
/** | |
* @description Returns all image/font/whatever URLs from all stylesheets present in the document | |
* @param styles {object|StyleSheetList} https://developer.mozilla.org/en-US/docs/Web/API/StyleSheetList | |
* @returns {array|string} | |
*/ | |
function getURLsFromCSS(styles) { | |
var urls = []; | |
for (var x in styles) { | |
var style = styles[x]; |
<div class="switch-wrapper"> | |
<input type="checkbox" class="checkbox" id="checkbox"/> | |
<label for="checkbox" class="switch" data-off="off" data-on="on"/> | |
</div> |
/* | |
* @description | |
* ported from Clojure's own [(every-pred)](https://clojuredocs.org/clojure.core/every-pred) | |
* array.everyPred(pred0, pred1...predN) | |
* | |
* From Clojure's documentation: | |
* Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logical true | |
* value against all of its arguments, else it returns false. | |
* Note that f is short-circuiting in that it will stop execution on the first argument that triggers a - | |
* logical false result against the original predicates. |
import * as React from "react"; | |
import { PropertyControls, ControlType } from "framer"; | |
const style: React.CSSProperties = { | |
height: "100%", | |
display: "flex", | |
alignItems: "center", | |
justifyContent: "center", | |
textAlign: "center", | |
color: "#8855FF", |
import * as React from "react"; | |
import { render } from "react-dom"; | |
import "./styles.css"; | |
function App(props) { | |
return ( | |
<div className="App"> | |
<h1> {props.text}</h1> | |
</div> |
import * as React from "react"; | |
import { render } from "react-dom"; | |
import "./styles.css"; | |
function App(props) { | |
return ( | |
<div className="App"> | |
<h1> {props.text}</h1> | |
</div> |