Skip to content

Instantly share code, notes, and snippets.


Cris Noble crismanNoble

View GitHub Profile
crismanNoble /
Created Apr 16, 2020
simple python server
python -m SimpleHTTPServer 1337
crismanNoble / snippet.js
Created Dec 31, 2019
[ASYNC examples] #javascript
View snippet.js
//do one thing after another is finished
const doThing = async function(timeout) {
const resp = await fetch(scheduleEndpoint, {method: 'POST', body: params}); //needs to return a promise?
return resp;
await doThing(); //do an api call or something async that returns a promise
console.log('all done'); //don't do anything else until that is finished.
//do a bunch of things in series, then do something else
View mc-form.html
<form class="mc-form-example" method="POST" action="./endpoint.php">
<h3>Newsletter Sign Up</h3>
<label for="mc-email">Email Address:</label>
<input type="email" id="mc-email" name="mc-email" required/>
<input type="text" value="pending" id="status" name="status" hidden/>
<input type="submit" value="Submit">
View mc-example-values.txt
api key: Y0UR_AP1_K3Y
datacenter: us6
list id: 24d099dff7
crismanNoble / mc-submit.js
Last active Sep 29, 2015
Simple form AJAX example
View mc-submit.js
//prevent the form from submitting via the browser redirect
//grab attributes and values out of the form
var data = {email: $('#mc-email').val()};
var endpoint = $(this).attr('action');
View mc-example.php
//fill in these values for with your own information
$api_key = 'Y0UR_AP1_K3Y';
$datacenter = 'us6';
$list_id = '24d099dff7';
$email = $_POST['email'];
$status = 'pending';
View Movie Example
"adult": false,
"backdrop_path": null,
"belongs_to_collection": null,
"budget": 500000,
"genres": [
"id": 27,
"name": "Horror"
View TV Example
"backdrop_path": "\/okhLwP26UXHJ4KYGVsERQqp3129.jpg",
"created_by": [
"id": 63554,
"name": "Dave Erickson",
"profile_path": null
"id": 1223867,
View ie8fontcdn.js
var tid = setInterval(function(){if (document.readyState!=='complete' ) return;clearInterval( tid );var head = document.head || document.getElementsByTagName('head')[0],style = document.createElement('style'), cssContent = ':before,:after{content:none !important}';style.type = 'text/css';if (style.styleSheet){style.styleSheet.cssText = cssContent;} else {style.appendChild(document.createTextNode(cssContent));}head.appendChild(style);setTimeout(function(){head.removeChild(style);}, 0);}, 40 );document.onreadystatechange;
View .editorconfig
root = true
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
trim_trailing_whitespace = true
You can’t perform that action at this time.