Skip to content

Instantly share code, notes, and snippets.

View 6ewis's full-sized avatar

Lewis 6ewis

  • Toronto, Ontario
View GitHub Profile
const accordionInstance = (
<Accordion>
<Panel header="Collapsible Group Item #1" eventKey="1">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</Panel>
<Panel header="Collapsible Group Item #2" eventKey="2">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, s
const Test = React.createClass({
render: function() {
return (
React.createElement(React.createClass({
getInitialState: function() {
return {term: "test"};
},
handleChange: function(event) {
this.setState({term: event.target.value});
@6ewis
6ewis / recursion-contains-key.clj
Last active April 7, 2016 21:01
(contains-key :a {:v 1 :b 3 :a 3 :g 6})
(boolean (seq (filter #(= k (key %)) m)))
(defn contains-key [m k]
(loop [[entry & rest :as coll] (seq m)]
(if (empty? coll)
false
(or (= (first entry) k)
(recur rest)))))
const data = [
{
"client_number": "00001",
"client_name": "voila Communications Ltd.",
"address1": "Ben votrant",
"address2": "voila Communications",
"address3": "P.O. Box 2086",
"address4": "55 Victoria Street",
"address5": "toronto",
"address6": "BERMUDA"
@6ewis
6ewis / mock_monster.rb
Created June 17, 2016 20:48 — forked from havenwood/mock_monster.rb
Mocking a few Monsters with Minitest::Mock
require 'minitest/mock'
##
# This monster eats Symbols. Give it a Symbol and how many to eat and nom nom!
monster = Minitest::Mock.new
monster.expect :eat, :nom_nom, [Symbol, Numeric]
##
# Let's verify the monster in fact ate its Symbols:
monster.verify
(defn remove-one [item list]
(let [[n m] (split-with (partial not= item) list)] (vec (concat n (rest m)))))
(defn sorting-sort [unsorted]
(loop [inner-unsorted unsorted sorted []]
(let [min-val (apply min inner-unsorted)]
(if
(or
(= 1 (count inner-unsorted))
(empty? inner-unsorted))
@6ewis
6ewis / Life cycle method
Created October 13, 2017 19:01
Describe the life-cycle method
/**
* ------------------ The Life-Cycle of a Composite Component ------------------
*
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
* - [children's componentWillMount and render]
* - [children's componentDidMount]
* - componentDidMount
@6ewis
6ewis / example.txt
Last active January 13, 2018 08:44
using reduce for updating nested object vs destructuring
image
@6ewis
6ewis / aws
Created November 21, 2018 17:43
s3 lambda permission
{
"Action": [
"s3:*",
],
"Effect": "Allow",
"Resource": [
"${module.s3_lambda_els_bucket.bucket_arn}",
]
}
@6ewis
6ewis / ramda-title-case.js
Created January 22, 2019 16:46 — forked from mrwithersea/ramda-title-case.js
Ramda Title Case
import R from 'ramda';
const capitalize =
R.converge(
R.concat(),
[
R.compose(
R.toUpper,
R.head
),