Skip to content

Instantly share code, notes, and snippets.

@Claire
Claire / README.md
Created May 23, 2021 02:13 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
function appendDiv(message) {
const div = document.createElement('div')
div.textContent = message
document.body.appendChild(div)
}
export {appendDiv}
@Claire
Claire / guid.js
Created January 10, 2020 00:37 — forked from omichelsen/guid.js
JS guid
export function create() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var guid = require('js/guid');
@Claire
Claire / curl.md
Created February 5, 2019 07:57 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Claire
Claire / Parent.js
Created December 5, 2017 01:32
pseudo code example of refs usage with 3rd party Popover menu
export class AContainer extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.setState({
targetElt: ReactDOM.findDOMNode(this.refs[targetRefName])
});
}
@Claire
Claire / gist:62ced086a977e074d6f418eb4c99558e
Created November 17, 2017 23:50 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@Claire
Claire / blurit.css
Last active November 16, 2017 00:00
How to blur content in css
html {
filter:blur(2px);
}
@Claire
Claire / readme.md
Last active September 8, 2017 03:09
myIcons
@Claire
Claire / jsRandomWithSeed.js
Last active August 8, 2017 00:20
example random with seed in javascript
function Rando(inSeed) {
origSeed = inSeed || Date.now();
result = {
// the initial seed
origseed : origSeed,
seed : origSeed,
seededRandom : function(max, min) {
@Claire
Claire / frontendDevlopmentBookmarks.md
Created April 9, 2017 05:14 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.