Skip to content

Instantly share code, notes, and snippets.

View richie-south's full-sized avatar

Richard richie-south

View GitHub Profile
@richie-south
richie-south / app.js
Created May 1, 2017 17:52
recursive anonymous function
const result = (startValue => (
fn => fn(fn, startValue)
)(
(fn, value) =>
value >= 10 ? value : fn(fn, value+1)
))(0)
console.log(result)
const result = (startValue => {
@richie-south
richie-south / webpack.config.js
Created April 10, 2017 19:54
webpack config template
const path = require('path')
const webpack = require('webpack')
const PROD = true
module.exports = {
entry: './app.js',
output: {
path: path.join(__dirname, '../public/scripts'),
filename: 'bundle.js',
},
'use strict';
import React from 'react';
import AudioRecorder from 'react-audio-recorder';
import LoginButton from './LoginButton'
import cookie from 'react-cookie';
export default class Button extends React.Component {
constructor(props){
super(props);
this.state = {
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin:0;
padding:0;
}
/* force scrollbar */
html { overflow-y: scroll; }
@richie-south
richie-south / gist:ceaf74701ca710f7fed9
Created April 25, 2015 12:58
server/klient nodejs
// SERVERN
// Create the http server.
http.createServer(function(req, res) {
res.writeHead(200, {
"Content-Type": "text/plain",
'Access-Control-Allow-Origin': '*'
});
var body = '';
@richie-south
richie-south / stuct
Last active August 29, 2015 14:17
Tror denna struktur blir enklare att coda med
window.cover = {
Stats: {
exp: {
amount: 0
},
level: {
amount: 0
},
fame: {
amount: 0
if (Number.isInteger(parseInt(number))){
var count0 = 0;
var countEven = 0;
var count = 0;
for (var i = 0; i < number.length; i++){
if (parseInt(number[i]) % 2 === 0){
if (parseInt(number[i]) === 0){
count0 += 1;