Skip to content

Instantly share code, notes, and snippets.

@sany2k8
sany2k8 / Commands.md
Last active April 1, 2017 08:02
Linux command cheat sheet in a single image
We couldn’t find that file to show.

Yii command line script

For default (No action exists)

  1. For connection establishment, copy contents of /protected/config/main.php to /protected/config/console.php with DB connection & other information
  2. Comment this line //'defaultController' => 'controller_name' (if_exists)
  3. Then create a file inside commands folder with any name you wish as per this convention yournameCommand.php e.g /protected/commands/SiteCommand.php
  4. Paste below code in SiteCommand.php File which extends from CConsoleCommand and have name SiteCommand
@sany2k8
sany2k8 / tmux-cheatsheet.markdown
Created May 8, 2017 07:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sany2k8
sany2k8 / README.md
Created July 9, 2017 16:59 — forked from hofmannsven/README.md
Simple Command Line Cheatsheet
@sany2k8
sany2k8 / README-Template.md
Created July 9, 2017 17:05 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@sany2k8
sany2k8 / container_shell_Dockerfile
Created July 9, 2017 17:06 — forked from PurpleBooth/container_shell_Dockerfile
A sensible PHP in Docker env
FROM php:5-cli
RUN apt-get update \
&& apt-get install -y \
git software-properties-common python-software-properties libicu-dev zlib1g-dev curl subversion bash \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
@sany2k8
sany2k8 / js-tricky-bits.md
Created July 11, 2017 17:43 — forked from amysimmons/js-tricky-bits.md
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@sany2k8
sany2k8 / vanilla-js-cheatsheet.md
Created July 12, 2017 16:32 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
<?php
/**
* @param $path
*/
function createDirectory($path){
if (!file_exists($path)) {
try{
mkdir($path, 0777, true);