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
/* Setup Rounting For All Pages */ | |
SApp.config(['$stateProvider', '$locationProvider', '$httpProvider', '$urlRouterProvider', function($stateProvider, $locationProvider, $httpProvider, $urlRouterProvider) { | |
$httpProvider.defaults.withCredentials = false; | |
$locationProvider.html5Mode(true); | |
// Redirect any unmatched url | |
$urlRouterProvider.when('', '/'); | |
$urlRouterProvider.otherwise("/"); |
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
var pathGen = function(title){ | |
// replaces all special characters and white spaces with DASH. | |
var path = title.replace( /([\s`~!@#$%^&*()_|+=?;:'",.<>\{\}\[\]\\\/])/gi, "-"); | |
path = path.replace(/([-]{2,})/gi, '-'); | |
return path; | |
}; | |
// source: http://stackoverflow.com/a/11090301/ |
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
# http://askubuntu.com/questions/78613/how-do-i-enable-the-universe-repository-from-the-command-line |
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 /Remove Panel Items >> ADD>>Keyboard Layout Handler | |
چک باکس Keep System Layout غیر فعال کنید سمت چپ قسمت Keyboard Layout زبان مورد نظر وارد کنید | |
[source: http://forum.ubuntu.ir/index.php?topic=90607.0] | |
another option is: | |
sudo dpkg-reconfigure keyboard-configuration |
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; |
OlderNewer