class ActionSequence extends React.Component {
state={
remaining = 60,
surname = "bond"
}
componentDidMount(){
this.timer =
setInterval(() => {
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 getChromeVersion = () => { | |
const raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./) | |
return raw ? parseInt(raw[2], 10) : false | |
} | |
if (getChromeVersion() < 93) { | |
alert('We recommend you use a Chrome browser version 93 or greater otherwise you may experience degraded service.') | |
} |
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 Axios = require('axios') | |
Axios({ | |
method: 'POST', | |
headers: { | |
Authorization: 'Basic thisisyourbase64authtoken', | |
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
}, | |
data: JSON.stringify({ | |
recipient: { |
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 axios = require("axios"); | |
const client = require("twilio")(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN); | |
const getDateObj = () => { | |
const date = new Date(); | |
const hour = date.getHours(); | |
const d = date.getDate(); | |
const m = date.getMonth() + 1; | |
const y = date.getFullYear(); | |
return { hour, date: `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}` }; |
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
// Usage: Run the below code in your termainal by either running node and copying the code into the REPL or by saving the code to a file and running node pattern.js | |
// It will output a consistent pattern no matter how high you count. | |
// Change 1000 to a higher number to test it | |
let number = 1; | |
while (number < 1000) { | |
next = number + 1; | |
let reduce = number * next + ""; | |
while (reduce.length > 1) { |
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
// To Run: | |
// deno run --allow-read --allow-net --allow-write ./bulkImageDownload.ts | |
const ROOT_URL = 'https://www.example.com/images/'; | |
const imgs = [ 'image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg' ]; | |
const init = () => | |
Promise.all( | |
imgs.map((fileName) => | |
fetch(ROOT_URL + fileName).then((resp) => resp.arrayBuffer()).then((buffer) => { |
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 firebase from "firebase/app"; | |
import "firebase/database"; | |
export const withFirebase = comp => { | |
comp.componentDidMount = () => { | |
if (!firebase.apps.length) { | |
firebase.initializeApp({ | |
apiKey: "", | |
authDomain: "", | |
databaseURL: "", |
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
{ | |
"version": 2, | |
"builds": [ | |
{ "src": "api/*.js", "use": "@now/node" }, | |
{ "src": "package.json", "use": "@now/next" } | |
], | |
"env": { | |
"STRIPE_SECRET_KEY": "@acj_stripe_secret_key" | |
}, | |
"routes": [{ "src": "/blog/(?<name>[^/]+)$", "dest": "/blog?id=$name" }] |
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
export default () => ( | |
<div id="wrapper"> | |
<div className="post"> | |
<h1>The Beginning</h1> | |
<h3>January 1998</h3> | |
<p> | |
I was trapped in hell . . . . . a hell of my own making. Two and a half | |
years prior to this date, I married a man I had no business marrying. | |
Our relationship should have never evolved past a first date, let alone | |
progress to marriage. I ignored all of the glaring, neon-flashing red |