Skip to content

Instantly share code, notes, and snippets.

View ratul0's full-sized avatar
🏠
Working from home

Yousuf Khan Ratul ratul0

🏠
Working from home
  • Kuehne+Nagel
  • Hamburg, Germany
  • 08:47 (UTC +02:00)
View GitHub Profile
@ratul0
ratul0 / phpstorm keyboard shortcuts
Last active October 11, 2016 06:36
phpstorm keyboard shortcuts
Find everything : ctrl+shift+A
Find any file : ctrl+shift+N
Select Code Block : Ctrl+W
Go to declaration : Ctrl+ Mouse 1
Find next occurrence : Ctrl+G
Find all occurrence : Ctrl+Alt+Shift+J
Duplicate current line or selected block : Ctrl +D
Delete line at caret : Ctrl + Y
Reformat code : Ctrl + Alt + L
Expand/collapse code block : Ctrl + NumPad +/-
@ratul0
ratul0 / BatchesController.php
Last active August 29, 2015 14:14
laravel controller template
<?php
class BatchesController extends \BaseController {
/**
* Display a listing of batches
*
* @return Response
*/
public function index()
@ratul0
ratul0 / provider.js
Created November 27, 2015 08:37
Angular Services Example
$provide.provider('books', function () {
this.$get = function(){
var appName = "Book Looger";
return {
appName: appName
};
}
});
@ratul0
ratul0 / provider.js
Created November 27, 2015 09:40
Angular service creation (Provider with Config option)
(function () {
var app = angular.module('app', []);
app.provider('books',function(){
this.$get = function(){
var appName = "BookLogger";
var version = '1.0';
@ratul0
ratul0 / factorySourceCode.js
Created November 27, 2015 10:24
Angular source code for factory method
function factory (name, factoryFn, enforce) {
return provider(name,{
$get : enforce !== false ? enforceReturnValue(name,factoryFn) : factoryFn
});
}
@ratul0
ratul0 / serviceSource.js
Last active November 27, 2015 10:48
Angular Service Source
function service (name, constructor) {
return factory(name,['$injector', function ($injector) {
return $injector.instantiate(constructor);
}]);
}
@ratul0
ratul0 / test.js
Created December 7, 2015 08:56
Re-declaring the same variable using let
if (x) {
let foo;
let foo; // TypeError thrown.
}
@ratul0
ratul0 / hoist.js
Created December 7, 2015 09:15
ES6 let keyword hoist
function do_something() {
console.log(foo); // ReferenceError
let foo = 2;
}
@ratul0
ratul0 / param.js
Created December 7, 2015 11:22
without default function params
var person = function(name){
name = name | "rat";
return name;
}
@ratul0
ratul0 / default.js
Created December 7, 2015 11:30
Default parameter in ES6
var person = function(name = "rat"){
return name;
}