Skip to content

Instantly share code, notes, and snippets.

View distinctgrey's full-sized avatar

Thomas De Groof distinctgrey

View GitHub Profile
'use strict'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Table, Menu, Icon, Segment, Input } from 'semantic-ui-react'
import capitalize from 'lodash/capitalize'
import flatten from 'lodash/flatten'
import orderBy from 'lodash/orderBy'
import debounce from 'lodash/debounce'
@kdzwinel
kdzwinel / concentrate.js
Last active February 11, 2020 17:29
DevTools snippet that lets you focus on a single element during developement
(function() {
function hideEvertyhingAround($el) {
const $parent = $el.parentElement;
$parent.style.transition = 'background-color 150ms ease-in';
$parent.style.backgroundColor = 'white';
$parent.childNodes.forEach($child => {
if($child !== $el && $child.style) {
@leonardofed
leonardofed / README.md
Last active July 19, 2024 17:51
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@iki
iki / gulpfile.js
Last active January 18, 2019 16:38
generating API documentation from RAML specification using raml2html in gulp
'use strict';
var gulp = require('gulp');
var path = require('path');
var CWD = path.resolve('.');
var API_SPEC = path.resolve(CWD, '../api/api.raml');
var API_DEST = path.resolve(CWD, '../server/static/docs/api');
var API_HTML = 'index.html';
@raine
raine / heroku-logs-with-bunyan.md
Last active August 3, 2018 19:14
Read heroku log output with bunyan

Read heroku logs output w/ bunyan

The stuff before the JSON in heroku logs output has to be cut off for bunyan to work.

$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan

Flag -l makes the output buffered by line.

@0gust1
0gust1 / build.js
Last active November 5, 2016 22:18
metalsmith static website build, with livreload
var extname = require('path').extname;
var Metalsmith = require('metalsmith');
var myth = require('myth');
var http = require('http');
var templates = require('metalsmith-templates');
var markdown = require('metalsmith-markdown');
var watch = require('metalsmith-watch');
/**
@bramdemoor
bramdemoor / gist:7264589
Last active December 27, 2015 04:09
Ruby Russian Roulette
require 'colorize'
class Revolver
def initialize(chamberCount)
@chambers = Array.new(chamberCount, false)
@chambers[0] = true
end
def spin
return @chambers.sample
end