Skip to content

Instantly share code, notes, and snippets.

@amitmbee
amitmbee / links.txt
Created March 22, 2018 06:02 — forked from kgrz/links.txt
All the links extracted out from https://news.ycombinator.com/item?id=12637239 as of 5th Oct 2016, 6:20PM
@amitmbee
amitmbee / on-jsx.markdown
Created March 22, 2018 06:01 — forked from kgrz/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

function anAction () {
return function (dispatch) {
dispatch(requestStarted())
return fetch().then(
function (success) {
dispatch(requestWasSuccessful(success));
},
function (error) {
dispatch(requestFailed(success));
@amitmbee
amitmbee / jenkins-remote-build-trigger.md
Created March 13, 2018 12:43 — forked from 4lun/jenkins-remote-build-trigger.md
How to trigger a remote build via a URL for a Jenkins job
  1. Create new user (e.g. webhook) with the following permissions: Overall > Read, Job > Build, Job > Read & Job > Workspace. Login as the user and get their API token
  2. Under a job, enable "Trigger Builds Remotely" and set an authentication token
  3. Trigger a POST request with the following structure:

http://{USER}:{API_TOKEN}@{JENKINS_URL}/job/{JOB}/build?token={AUTHENTICATION_TOKEN}

@amitmbee
amitmbee / browser-and-engine.js
Created March 7, 2018 05:17 — forked from derek-knox/browser-and-engine.js
Simple method definition and execution with detailed comments on browser and engine behavior. Anything missing or incorrect in the comment breakdown?
function makeBackgroundBlack() {
document.body.style.backgroundColor = '#000000';
}
makeBackgroundBlack();
/*
- browser parses html
- browser sees <script> - blocks (and downloads if src attr)

git log --graph --all --decorate --pretty --oneline