Skip to content

Instantly share code, notes, and snippets.

View psaitu's full-sized avatar
👋
hello!

Prabhu Saitu psaitu

👋
hello!
View GitHub Profile
Bringing machine 'blimp' up with 'virtualbox' provider...
==> blimp: Importing base box 'ubuntu-12.04-amd64-daily'...
==> blimp: Matching MAC address for NAT networking...
==> blimp: Setting the name of the VM: blimp_blimp_1427301836223_13691
==> blimp: Clearing any previously set forwarded ports...
==> blimp: Clearing any previously set network interfaces...
==> blimp: Preparing network interfaces based on configuration...
blimp: Adapter 1: nat
blimp: Adapter 2: hostonly
==> blimp: Forwarding ports...
.image_wrapper {
width: 119px;
margin: 0 auto;
overflow: hidden;
height: 118px;
display: inline-block;
img {
$( '.tree li' ).each( function() {
if( $( this ).children( 'ul' ).length > 0 ) {
$( this ).addClass( 'parent' );
}
});
$( '.tree li.parent > a' ).click( function( ) {
$( this ).parent().toggleClass( 'active' );
$( this ).parent().children( 'ul' ).slideToggle( 'fast' );
});
@psaitu
psaitu / factory_automobile.php
Created September 1, 2014 18:29
Php Factory Pattern Example
<?php
class Automobile
{
private $vehicle_make;
private $vehicle_model;
public function __construct($make, $model)
{
$this->vehicle_make = $make;
$this->vehicle_model = $model;
function Post(options) {
this.title = options.title || "A New Post";
this.author = options.author || "Anonymous";
this.blob = options.blob || "This post is emply...";
}
var MyApp = {}
post_options = {
title: "A Beautiful Day",
function CarDoor(options) {
this.color = options.color || "red";
this.side = options.side || "right";
this.hasPowerWindows = options.hasPowerWindows || true;
}
function CarSeat(options) {
this.color = options.color || "gray";
this.material = options.material || "leather";
this.isReclinable = options.isReclinable || true;
var div_element = document.querySelector("div");
var element = document.querySelector(".class_name");
@psaitu
psaitu / let_variable.js
Created August 18, 2014 10:32
declaring variables with limited scope in javascript
function do_something() {
let foo;
let foo; // This works fine.
}