This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fix for showing images in dabr.co.uk | |
var linkembeds = $('.embed a'); | |
for(var i = 0; i < linkembeds.length; i++){ | |
var link = $(linkembeds[i]); | |
var linkToImage = link.attr('href').replace('large', 'small'); | |
var imgInLink = link.find('img'); | |
imgInLink.attr('src', linkToImage); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// needs ui router 0.2.12+ | |
// ... | |
var Product: { | |
url: '^/p/:productId/{productAlias}', | |
params: { | |
productAlias: {value: null, squash: true} | |
} | |
} | |
.state('product', Product); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeNumbers = () => { | |
let n = 0 | |
return {next: () => { | |
n += 1 | |
return n | |
} | |
} | |
numbers = makeNumbers() | |
numbers.next() // 1 | |
numbers.next() // 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Google Maps Multiple Markers</title> | |
<meta charset="utf-8"> | |
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors',1); | |
error_reporting(E_ALL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside directive | |
function linkFunc(scope, element, attrs, ctrl) { | |
element.on('change', '.file-logo', function(event) { | |
ctrl.onFileSelect(event.target.files); | |
}); | |
} | |
function Controller() { | |
var vm = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set permission of all files and folders. 755 and 644. | |
find . -type d -exec chmod 755 {} \; | |
find . -type f -exec chmod 644 {} \; | |
find ./app/cache -type d -exec chmod 777 {} \; | |
find ./app/logs -type d -exec chmod 777 {} \; | |
find ./web/upload -type d -exec chmod 777 {} \; | |
#find /opt/lampp/htdocs -type d -exec chmod 755 {} \; | |
#find /opt/lampp/htdocs -type f -exec chmod 644 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add a ssh key to list of ssh keys of git | |
# first ensure that ~/.ssh/ folder is writable by current user. (if you are logged in as root can't solves this, change user by `su anotheruser` and then `chown anotheruser:anotheruser /home/anotheruser/.ssh/`) | |
# add a new key to .ssh/ folder of current user home. | |
ssh-keygen | |
# enter full address. `/home/anotheruser/.ssh/your_ssh_key_name` | |
# enter a passphrase | |
# if you used id_rsa as the name of key no need this step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
DocumentRoot /opt/lampp/htdocs/path/to/project/folder | |
ServerName mynewhost.com | |
ServerAlias *.mynewhost.com | |
</VirtualHost> | |
# Also add: 127.0.0.1 mynewhost.com to hosts file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>در حال بروزرسانی</title> | |
<meta name="viewport" content="width=device-width"> | |
<style> | |
body { | |
text-align: center; |