Skip to content

Instantly share code, notes, and snippets.

View azimidev's full-sized avatar
:octocat:
Pro

Azimi azimidev

:octocat:
Pro
View GitHub Profile
@azimidev
azimidev / reload.html
Created October 11, 2015 21:43
This script is used for gulp-reload in your index.html file for reload the page automatically
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@azimidev
azimidev / prepare_laravel_for_shared_hosting
Created December 13, 2015 00:59
Shell script to prepare Laravel for shared hosting
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
@azimidev
azimidev / commandline
Last active May 21, 2016 14:08
Simple PHP and Python Web Server
php -S localhost:8888
[OR]
open http://localhost:8000 && python -m SimpleHTTPServer
@azimidev
azimidev / .htaccess
Last active June 19, 2016 22:02
Parsclick htaccess
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
ErrorDocument 400 /400
ErrorDocument 403 /403
ErrorDocument 404 /404
ErrorDocument 500 /500
<IfModule mod_rewrite.c>
@azimidev
azimidev / Human-Height-Array.php
Last active March 18, 2017 21:46
Human height to use in array format with key as CM and value as foot
'91' => "3' 6\"",
'94' => "3' 1\"",
'97' => "3' 2\"",
'99' => "3' 3\"",
'102' => "3' 4\"",
'104' => "3' 5\"",
'107' => "3' 6\"",
'109' => "3' 7\"",
'112' => "3' 8\"",
'114' => "3' 9\"",
@azimidev
azimidev / Repair Disk Permission.md
Created April 13, 2017 01:47
Repair Disk Permission Mac

Verify:

sudo /usr/libexec/repair_packages --verify --standard-pkgs /

Repair:

sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /

@azimidev
azimidev / Contract Killer.md
Last active April 13, 2017 02:21 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Between [company name]

And [customer name].

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

@azimidev
azimidev / Amir - Material.icls
Created May 18, 2017 12:50
PHPStorm Amir Theme
<scheme name="Amir - Material" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<option name="LINE_SPACING" value="1.5" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_LIGATURES" value="true" />
<option name="EDITOR_FONT_NAME" value="Fira Code" />
<colors>
<option name="ADDED_LINES_COLOR" value="212c32" />
<option name="ANNOTATIONS_COLOR" value="8b999f" />
<option name="BORDER_LINES_COLOR" value="" />
<?php
/* PHP */ /* JavaScript */
mb_strpos($myEmail, '@'); myEmail.indexOf('@');
str_replace('@', '[at]', $myEmail); myEmail.replace('@', '[at]');
mb_substr($myEmail, 0, 5); myEmail.substr(0, 5);
mb_strlen($myEmail); myEmail.length;
(int) '10'; parseInt('10');
array_key_exists('name', $user); 'name' in user;
in_array('Book 1', $userBooks); userBooks.includes('Book 1');
time(); Date.now();
import Vue from 'vue/dist/vue.esm'
import TurbolinksAdapter from 'vue-turbolinks'
import VueResource from 'vue-resource'
Vue.use(VueResource)
document.addEventListener('turbolinks:load', () => {
Vue.http.headers.common['X-CSRF-Token'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content')
var Profiles = Vue.extend({