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
/******************************* | |
* MODAL AS LEFT/RIGHT SIDEBAR | |
* Add "left" or "right" in modal parent div, after class="modal". | |
* Get free snippets on bootpen.com | |
*******************************/ | |
.modal.left .modal-dialog, | |
.modal.right .modal-dialog { | |
position: fixed; | |
margin: auto; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HMAC-SHA256 Example</title> | |
</head> | |
<body> | |
<script src="http://crypto.stanford.edu/sjcl/sjcl.js"></script> | |
<script> | |
var sharedSecret, query, signature, hmac, xhr; |
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
$resource('/path/to/api/resource', null, { | |
upload: { | |
method: 'POST', | |
headers: { 'Content-Type': undefined }, | |
transformRequest: function (data) { | |
var formData = new FormData(); | |
formData.append("data", angular.toJson(data.model)); | |
angular.forEach(data.files, function (fileData) { |
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
/* These are technically the same, but use both */ | |
overflow-wrap: break-word; | |
word-wrap: break-word; | |
-ms-word-break: break-all; | |
/* This is the dangerous one in WebKit, as it breaks things wherever */ | |
word-break: break-all; | |
/* Instead use this non-standard one: */ | |
word-break: break-word; |
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
angular.directive('autoFocus', function(){ | |
return function(scope, element){ | |
element[0].focus(); | |
}; | |
}); | |
/* | |
<div> | |
<input type="text" auto-focus /> |
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
(function () { | |
'use strict'; | |
angular | |
.module('app') | |
.filter('slugify', Filter); | |
function Filter() { | |
return function (input) { | |
if (!input) |
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
<span>Local date & time converted from UTC: {{vm.myUtcDate | utcToLocal:'dd.MM.yy - hh.mm a'}}</span> | |
<!-- Where vm.myUtcLocal = '2016-03-31T00:11:31' (utc) --> |
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
/** | |
* Format datetime | |
* Usage: | |
* new Date().format('yyyy/MM/dd'), new Date().format('hh:mm:ss') | |
* @param {String} format | |
* @return {String} | |
*/ | |
Date.prototype.format = function(format) { | |
var self = 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
/** | |
* @ngdoc Directive | |
* @name app.confirmOnExit | |
* | |
* @description | |
* Prompts user while he navigating away from the current route (or, as long as this directive | |
* is not destroyed) if any unsaved form changes present. | |
* | |
* @element Attribute | |
* @scope |
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
[ | |
{ "name": "Afghanistan", "code": "AF" }, | |
{ "name": "Åland Islands", "code": "AX" }, | |
{ "name": "Albania", "code": "AL" }, | |
{ "name": "Algeria", "code": "DZ" }, | |
{ "name": "American Samoa", "code": "AS" }, | |
{ "name": "Andorra", "code": "AD" }, | |
{ "name": "Angola", "code": "AO" }, | |
{ "name": "Anguilla", "code": "AI" }, | |
{ "name": "Antarctica", "code": "AQ" }, |