Skip to content

Instantly share code, notes, and snippets.

View pavanpodila's full-sized avatar
🎯
Playing darts with MobX

Pavan Podila pavanpodila

🎯
Playing darts with MobX
View GitHub Profile
@pavanpodila
pavanpodila / CollectionView.coffee
Created January 15, 2012 22:02
A CollectionView class that monitors Backbone.Collections and renders the item Views
define ->
# The CollectionView class provides a simple view manager for a Backbone Collection.
# It listens to changes on the collection and reflects that on the view. It also provides
# view filtering, grouping and sorting capabilities.
class CollectionView extends Backbone.View
initialize: (options)->
throw "collection property must be specified." if not @collection
@_ready = $.Deferred()
@pavanpodila
pavanpodila / htaccess_rewrite_generator.rb
Created May 24, 2012 15:44
Script to generate Rewrite conditions for .htaccess
require 'rubygems'
require 'nokogiri'
require 'date'
def newUrl(baseUrl, date, name)
"#{baseUrl}/#{date.strftime '%Y/%m'}/#{name}"
end
def writeMap(items)
txtFile = File.open 'urlmap.txt', 'w'
@pavanpodila
pavanpodila / favicon_generator.rb
Created May 25, 2012 11:32
Generate Favicons using RMagick. Includes a Middleman-3.0 extension
###
# Simple Script to generate favicons from a base PNG image
# Relies on RMagick to do the job
# Also includes a Middleman-3.0 extension
###
require 'fileutils'
class MagickFavicon
include Magick
@pavanpodila
pavanpodila / create_export_pack.sh
Last active April 20, 2024 11:41
Export each Git branch as a separate folder
previous_pwd=$PWD
cd $(dirname $0)
PROJECT="$HOME/Desktop/project"
EXPORT_DIR="$HOME/Desktop/export"
rm -rf $EXPORT_DIR
mkdir -p $EXPORT_DIR
@pavanpodila
pavanpodila / index.template.hbs
Last active June 30, 2020 01:35
Webpack, Karma Config files for Angular 1.5.x
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{htmlWebpackPlugin.options.title}}</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/images/favicon.png">
{{#htmlWebpackPlugin.files.css}}
@pavanpodila
pavanpodila / Configure VSCode for GAE Go SDK.md
Last active July 20, 2017 05:40
Configure VSCode for Google App Engine Go SDK

You need to install the vscode-go extension after changing the go binary to point to the GAE version.

  • Symlink the goapp binary
> cd $PATH_TO_GAE_SDK/go_appengine/goroot/bin
> ln -s goapp go
  • Install vscode-go extension
  • Ensure gocode is on your $PATH, normally located in $GOPATH/bin
@pavanpodila
pavanpodila / React Component Patterns.md
Last active August 30, 2017 02:05
Patterns of React Components
  • Higher Order Components
  • Function as Child Component
  • React Context for data propagation
  • Delegation for passing multiple callbacks, as popularized by the Cocoa framework
  • Controlled Inputs with value + onChange
  • Presentation Components which are purely for render
  • Container components that connect to data stores
  • Layout Containers
  • PureComponents that change when props change
@pavanpodila
pavanpodila / mobx-crash-course.md
Last active September 20, 2018 01:47
MobX Crash Course

The Observable Triad

ACTIONS ==> OBSERVABLES ==> REACTIONS

Observables

  • Concept of reactive-data
  • Various decorators to simplify marking properties as observables
@pavanpodila
pavanpodila / metadata-loader.js
Created October 7, 2019 04:31
A webpack-loader that reads Component metadata and generates a *.component.json file
const parser = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const generator = require('@babel/generator').default;
module.exports = function(source) {
// Parse to get the AST
const ast = parser.parse(source, {
sourceType: 'module',
plugins: [
'jsx',
[
@pavanpodila
pavanpodila / metadata.loader.js
Created October 7, 2019 05:11
Metadata Loader files
const parser = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const generator = require('@babel/generator').default;
module.exports = function(source) {
// Parse to get the AST
const ast = parser.parse(source, {
sourceType: 'module',
plugins: [
'jsx',
[