Skip to content

Instantly share code, notes, and snippets.

@eyesofkids
eyesofkids / factorial.swift
Last active March 4, 2023 15:51
factorial.swift
func factorial(a: Int) -> Int {
let n = a
if(n == 1){
return 1
}else{
return n*factorial(n-1)
}
}
factorial(5)
@eyesofkids
eyesofkids / Child.js
Created August 22, 2016 09:44
Simple React Lifecycle methods test
import React from 'react'
var Child = React.createClass({
getInitialState: function(){
console.log('Child getInitialState');
return { value: 'start'}
},
getDefaultProps: function(){
console.log('Child getDefaultProps');
@eyesofkids
eyesofkids / functional-utils.js
Created August 26, 2016 02:03 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@eyesofkids
eyesofkids / gist:114e840b0811ed906f40f73e69cb82cf
Created September 7, 2016 03:48 — forked from AliMD/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@eyesofkids
eyesofkids / .eslintrc
Created October 7, 2016 09:55 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@eyesofkids
eyesofkids / notes.md
Created December 4, 2017 09:39 — forked from matthewjberger/notes.md
How to make an electron app using Create-React-App and Electron with Electron-Builder.
import React, { useState, useEffect } from 'react';
import { IoIosArrowForward } from 'react-icons/io';
import { withRouter } from 'react-router-dom';
import CartCounter from '../components/CartCounter'
import CartDelete from '../components/CartDelete'
import CartCheckbox from '../components/CartCheckbox'
import { Spinner } from 'react-bootstrap'
import React, { useState, useEffect } from 'react'
import Form from 'react-bootstrap/Form'
import { Col, Button, Row } from 'react-bootstrap'
import Spinner from 'react-bootstrap/Spinner'
import { BrowserRouter as Router } from 'react-router-dom'
function MyFile() {
const [validated, setValidated] = useState(false)
const [loading, setLoading] = useState(false)
const [user, setUser] = useState([])
import React, { useState, useEffect } from 'react'
import MemberMyFiles from './MemberMyFiles'
//import MemberMyCollection from './MemberMyCollection'
//import MemberMyDiscount from './MemberMyDiscount'
//import MemberInquire from './MemberInquire'
//import NotFoundPage from './NotFoundPage'
import {
BrowserRouter as Router,
Route,
Link,