Skip to content

Instantly share code, notes, and snippets.

@amitmbee
amitmbee / project-guidelines.md
Created January 27, 2018 07:40
[Project Guidelines]

中文版 | 日本語版 | 한국어

Project Guidelines · PRs Welcome

While developing a new project is like rolling on a green field for you, maintaining it is a potential dark twisted nightmare for someone else.

@amitmbee
amitmbee / readme-structure.md
Created January 27, 2018 07:42
[Readme.md Structure] #md

Logo of the project

Name of the project

Additional information or tag line

A brief description of your project, what it is used for.

Installing / Getting started

A quick introduction of the minimal setup you need to get a hello world up &

@amitmbee
amitmbee / onHeadersReceived.js
Created January 30, 2018 11:48
[Set response headers on Chrome extensions API]
chrome.webRequest.onHeadersReceived.addListener(//For getting responses : use onHeadersReceived Event
callback,
{
urls: ["<all_urls>"],
types: ["xmlhttprequest"],
},
["blocking", "responseHeaders"]// For response event use ["blocking", "responseHeaders"] filters and return {responseHeaders: details.responseHeaders}; to block and modify requests
);
function callback(details){

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

@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)
@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}

function anAction () {
return function (dispatch) {
dispatch(requestStarted())
return fetch().then(
function (success) {
dispatch(requestWasSuccessful(success));
},
function (error) {
dispatch(requestFailed(success));
@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'

@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 / setup.md
Created April 12, 2018 10:33 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "[email protected]"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T [email protected]