Skip to content

Instantly share code, notes, and snippets.

View boopathi's full-sized avatar
💭
I may be slow to respond.

Boopathi Rajaa boopathi

💭
I may be slow to respond.
View GitHub Profile
@boopathi
boopathi / README.md
Last active August 29, 2015 14:27
Differentiate between an arrow function, class, method, generator and a normal function in ES6
@boopathi
boopathi / Workflow.md
Created June 20, 2015 20:25
A simple git workflow that works
  • git pull --rebase always
  • git checkout -b feature/my-awesome-feature before committing anything
  • git commit --amend whenever possible
  • git commit --fixup and git commit --squash in case you pushed to origin and you don't want to force push now
  • Write long and meaningful commit messages
  • Create a Pull Request and continue pushing more commits till review is accepted
  • git rebase -i --autosquash master feature/my-awesome-feature and squash all unwanted commits
  • git push --force-with-lease origin my-awesome-feature when branches have diverged
  • Merge the Pull Request
@boopathi
boopathi / index.js
Last active August 29, 2015 14:22
requirebin sketch
var State = require('ampersand-state');
var Person = State.extend({
props: {
firstName: 'string',
lastName: 'string'
},
derived: {
cachedFullName: {
deps: ['firstName', 'lastName'],
@boopathi
boopathi / index.js
Last active August 29, 2015 14:19
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Model = require('ampersand-state');
var Collection = require('ampersand-collection');
var Item = Model.extend({
props: {
name: 'string'
}
@boopathi
boopathi / README.md
Last active August 28, 2023 14:35
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@boopathi
boopathi / vim_settings.sh
Created January 22, 2015 23:07
My Vim settings
# Install pathogen
cd
git clone git@github.com:tpope/vim-pathogen .vim
mkdir .vim/bundle
cd .vim/bundle
# Install SuperTab
git clone git@github.com:ervandew/supertab
# Install Syntastic
@boopathi
boopathi / sw.js
Last active August 29, 2015 14:13
sw.js
self.CACHE_NAME = ["cats-v", 14];
var cache_name = self.CACHE_NAME[0] + self.CACHE_NAME[1];
self.addEventListener('fetch', function(event) {
var cacheRequest = event.request.clone();
event.respondWith(caches.match(cacheRequest).then(function(response) {
if(response) return response;
var fetchRequest = event.request.clone();
return fetch(fetchRequest).then(function(response) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="inverter">
</div>
<script id="jsbin-javascript">
var B = require("bluebird/js/main/promise")();
var Bproto = B.prototype;
var deferredPrototype = B.pending().constructor.prototype;
deferredPrototype.makeNodeResolver = function() {
return this.asCallback;
};
function bind(fn, ctx) {
@boopathi
boopathi / output
Last active April 14, 2019 17:04
File descriptors - stdin and stdout - isTTY ? in a forked process
Case I: node parent
Parent: true From tty: true
Parent: true From tty: true
TTY: true From tty: true
TTY: true From tty: true
Case II: node parent > asdf
Parent: true From tty: true
Parent: undefined From tty: true
TTY: true From tty: true