Skip to content

Instantly share code, notes, and snippets.

View akash-pal's full-sized avatar
🎯
Focusing

Akash Pal akash-pal

🎯
Focusing
View GitHub Profile
@akash-pal
akash-pal / this.js
Created May 25, 2018 12:31
How this works in Javascript
Implicit binding
=========================================================
var obj = {
name: 'Saurabh',
display: function(){
console.log(this.name); // 'this' points to obj
}
};
obj.display(); // Saurabh
@akash-pal
akash-pal / imageCache.js
Created May 19, 2018 09:52
Cache Images in Stack
// Our image loading code USED to be:
//
// var img = new Image();
// img.onLoad = function(){...}
// img.src = “asdf.png”
//
// Use the provided gCachedAssets cache below to first
// check if the image has already been loaded.
@akash-pal
akash-pal / main.dart
Created May 17, 2018 16:45
Udacity flutter Hello Rectangle.
//// Copyright 2018 The Chromium Authors. All rights reserved.
//// Use of this source code is governed by a BSD-style license that can be
//// found in the LICENSE file.
//
//import 'package:flutter/material.dart';
//
//void main() {
// runApp(
// MaterialApp(
// debugShowCheckedModeBanner: false,
@akash-pal
akash-pal / gulpFile.js
Created December 25, 2016 19:48
Ionic Gulp File
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
@akash-pal
akash-pal / angularjs_directive_attribute_explanation.md
Created December 1, 2016 10:28 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@akash-pal
akash-pal / mysql_to_couchdb.js
Created June 7, 2016 18:29 — forked from cfaulkingham/mysql_to_couchdb.js
This is a script to convert a MySQL table to a CouchDB database.
/*
Copyright (C) 2011 Colin Faulkingham, http://3a2d29.com/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@akash-pal
akash-pal / README.md
Last active August 29, 2015 14:12 — forked from mbostock/.block