Skip to content

Instantly share code, notes, and snippets.

View muzfr7's full-sized avatar
🎯
Knowledge is power..

Muzafar Ali muzfr7

🎯
Knowledge is power..
View GitHub Profile
@muzfr7
muzfr7 / Vagrantfile
Last active July 31, 2017 03:48
Sample Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
@muzfr7
muzfr7 / Homestead.yaml
Last active July 31, 2017 07:39
Sample Homestead.yml file
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
# VM Name in Virtual Box
name: Homestead
authorize: ~/.ssh/id_rsa.pub
@muzfr7
muzfr7 / 1-LoadWorkspaces.php
Last active August 17, 2017 17:34
Sample Doctrine Fixture to default load users in database!
<?php
namespace AppBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use AppBundle\Entity\Workspace;
/**
@muzfr7
muzfr7 / ConvertMultidimensionalArrayToObject.php
Last active February 6, 2018 09:44
Converts given Multi-dimensional Array to Object, using Recursive Function Approach
<?php
// A multi-dimensional array
$user = [
'firstname'=>'Muzafar',
'lastname'=>'Jatoi',
'contacts'=>[
[
'mobile'=>'0500000000',
'email'=>'[email protected]',
@muzfr7
muzfr7 / template.go
Last active December 31, 2022 02:31
A Go package to pre-compiles and register all the templates in a directory and it's subdirectories. FYI – this won't be a suitable approach if you have same file names in subdirectories!
package template
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
"text/template"