Skip to content

Instantly share code, notes, and snippets.

@awareness481
awareness481 / quotes.html
Created February 8, 2017 13:54
Rnd Quotes Test
<button id="quotes">New Quote</button>
<div id ="title"></div>
<p id ="content"></p>
<!-- JS file is inserted using Codepen -->
for (var i = 0; i < 11; i++) {
start(i);
}
function start(i) {
setTimeout(function(){
console.log("i:" + i);
}, 1000);
}
@awareness481
awareness481 / helpers.c
Created May 29, 2017 16:12
control may reach end of non-void function [-Werror,-Wreturn-type] }
#include <cs50.h>
#include <string.h>
#include "helpers.h"
#include <stdio.h>
/**
* Returns true if value is in array of n values, else false.
*/
bool search(int value, int values[], int n)
{
@awareness481
awareness481 / .js
Created June 17, 2017 19:09
400, no client-id specified
const channels = "ESL_SC2, OgamingSC2, cretetion, freecodecamp, storbeck, habathcx, RobotCaleb, noobs2ninjas";
const end = `https://api.twitch.tv/kraken/streams/channel=${channels}`;
const streams = [];
const myHeaders = new Headers();
myHeaders.append("Client-Id", "lfy14565wb4omezslcd2a3unt3zcv9");
const init = {
method: 'GET',
Headers: myHeaders
@awareness481
awareness481 / .json
Created June 20, 2017 16:15
Early version for testing
[
{
"keyword": "factorial",
"syntax": "\\frac{numerator}{denominator}"
},
{
"keyword": "binomial",
"syntax": "\\binom{n}{k}"
},
{
[
{
"key": "",
"desc": " \\\\* terminates a line, but disallows a pagebreak.\n"
},
{
"key": "",
"desc": "\n"
},
{
[
{
"key": " ",
"desc": " \n"
},
{
"key": "\\* ",
"desc": "erminates a line, but disallows a pagebreak.\n"
},
{
[
{
"key": "\\frac{num}{den}",
"description": "Create a fraction. The num stands for numerator and den for denominator"
},
{
"key": "\\dfrac{num}{den}",
"description": "Fraction in display mode"
},
{
{
"name": "tests",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha **/*.test.js",
"test-watch": "nodemon --exec \"npm test\""
},
"author": "",
import React from 'react';
export default class Action extends React.Component {
constructor(props) {
super(props);
this.handleAction = this.handleAction.bind(this);
}
handleAction (e) {