Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Pro

Amir Hassan Azimi hassanazimi

:octocat:
Pro
View GitHub Profile
@hassanazimi
hassanazimi / reload.html
Created Oct 11, 2015
This script is used for gulp-reload in your index.html file for reload the page automatically
View reload.html
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@hassanazimi
hassanazimi / prepare_laravel_for_shared_hosting
Created Dec 13, 2015
Shell script to prepare Laravel for shared hosting
View 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
@hassanazimi
hassanazimi / commandline
Last active May 21, 2016
Simple PHP and Python Web Server
View commandline
php -S localhost:8888
[OR]
open http://localhost:8000 && python -m SimpleHTTPServer
@hassanazimi
hassanazimi / .htaccess
Last active Jun 19, 2016
Parsclick htaccess
View .htaccess
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
ErrorDocument 400 /400
ErrorDocument 403 /403
ErrorDocument 404 /404
ErrorDocument 500 /500
<IfModule mod_rewrite.c>
@hassanazimi
hassanazimi / Human-Height-Array.php
Last active Mar 18, 2017
Human height to use in array format with key as CM and value as foot
View Human-Height-Array.php
'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\"",
View Repair Disk Permission.md

Verify:

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

Repair:

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

@hassanazimi
hassanazimi / Contract Killer.md
Last active Apr 13, 2017 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer.md

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;

View Amir - Material.icls
<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="" />
View gist:e1b441f4399db1d006fb95b54943c754
<?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();
View vue.js
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({