Skip to content

Instantly share code, notes, and snippets.

@nonlogos
nonlogos / Syntax and comments
Last active December 15, 2016 21:29
Advanced CSS - CSS reset addition
Interesting comment strategies
<!--
=========================
First Section or section name
=========================
-->
html elements:
@nonlogos
nonlogos / functional-programming
Last active December 28, 2016 16:57
Functional Programming Concepts and Examples
// Pure Functions
// Programming without side-effects
Remove:
1. Assignments
2. Loops (use recursion instead)
3. Freeze all array literals and object literals (remove Date and Math.random)
// MONAD
@nonlogos
nonlogos / Custom-Date-picker
Last active December 21, 2016 19:19
date-picker
resource: http://amsul.ca/pickadate.js/date/
source files: https://github.com/amsul/pickadate.js/tree/master/lib
react specific:
https://github.com/airbnb/react-dates // chosen
https://www.codementor.io/chrisharrington/tutorials/build-date-picker-react-js-classes-du107v566
https://github.com/Hacker0x01/react-datepicker
https://github.com/zippyui/react-date-picker
other examples:
@nonlogos
nonlogos / App_Building_Process
Last active February 15, 2017 00:06
REACT NOTES
1. Build app with dummy data
2. replace dummy data with ajax
3. write middleware to help fetch data
@nonlogos
nonlogos / RXJS
Last active January 5, 2017 19:26
Reactive Programming
source links:
https://egghead.io/courses/introduction-to-reactive-programming
https://github.com/Reactive-Extensions/RxJS/blob/master/doc/gettingstarted/events.md
https://www.youtube.com/watch?v=vMD5lFt6P80
@nonlogos
nonlogos / D3
Last active January 9, 2017 16:38
All about D3
// simple bar chart
<!DOCTYPE html>
<html>
<head>
<title>Make a simple line chart</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<style type="text/css">
rect:hover {
fill: yellow;
@nonlogos
nonlogos / Advice
Last active January 11, 2017 20:50
React Animation
//Resources
// https://css-tricks.com/productive-in-react/ -which unfortunately uses the deprecated getDOMNode in its examples. Simply swap out for findDOMNode and start animating.
// https://css-tricks.com/comparison-animation-technologies/
// https://medium.com/@cheapsteak/animations-with-reacttransitiongroup-4972ad7da286#.lghp7hj3f
// https://medium.com/@chenglou/react-motion-and-animated-4b3edf671cba#.h9ex9o8fy
// How to use SVGS
1. for animated background svgs (when we don't need react to render):
Use SVG directly inline in the html, for loops
@nonlogos
nonlogos / AWS_apex
Last active January 18, 2017 17:28
All things about AWS Apex deploy
1. create a new user specifically for Apex
- go to IAM management
- create a new user called "apex-deploy"
- click on "generate an access key"
- get "user security credit" - access key ID, secret access key by downloading them
- click on the user and go to permissions
//get lambda policy
- click on "Attach Policy" and search for "lambda"
- select "AWSLambdaFullAccess" //bad practice
// get IAM policy
@nonlogos
nonlogos / Merge_methods
Last active January 11, 2017 20:26
All the cool patterns to use with reduce
// I'm trying to merge the methods of two objects into one such that an array of methods results for each property in the parent object:
//obj1 = {"prop1":"method1","prop2":"method2"}
//obj2 = {"prop1":"method3","prop2":"method4"}
//Desired output:
//obj1 = {"prop1":["method1","method3"],"prop2":["method2","method4"]}
var merge = function(/*...objs*/) {
return [].reduce.call(arguments, function(acc, x) {
@nonlogos
nonlogos / Animating_with_CSS
Last active November 16, 2022 02:03
SVG animation with CSS and Greensock
// Animating with CSS, refresher
// Keyframes
@keyframes animation-name-you-pick {
0% {
background: blue;
transform: translateX(0);
}
50% {