#AngularJS Promises
This file contains hidden or 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
#!/usr/bin/env node | |
var program = require('commander'); | |
var request = require('request'); | |
var chalk = require('chalk'); | |
program | |
.version('0.0.1') | |
.usage('[options] <keywords>') | |
.option('-o, --owner [name]', 'Filter by the repositories owner') |
This file contains hidden or 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 a /Date(XXXXXXXXXXXXXXXX)/ into a JSON date object. | |
angular.module('jsonDate', []).filter('jsonDate', function () { | |
return function (input, format) { | |
if (angular.isUndefined(input)) | |
return; | |
// first 6 character is the date | |
var date = new Date(parseInt(input.substr(6))); |
This file contains hidden or 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
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
* Anchor Smooth Scroll - Smooth scroll to the given anchor on click | |
* adapted from this stackoverflow answer: http://stackoverflow.com/a/21918502/257494 | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
angular.module('yourapp').directive('anchorSmoothScroll', function($location) { | |
'use strict'; | |
return { | |
restrict: 'A', | |
replace: false, |
This file contains hidden or 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 | |
$recepient = "[email protected]"; | |
$sitename = "site.ru"; | |
$service = trim($_POST["formInputService"]); | |
$name = trim($_POST["formInputName"]); | |
$email = trim($_POST["formInputEmail"]); | |
$tel = trim($_POST["formInputTel"]); | |
$text = trim($_POST["formInputComment"]); |
This file contains hidden or 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 | |
// Check for empty fields | |
if(empty($_POST['name']) || | |
empty($_POST['email']) || | |
empty($_POST['phone']) || | |
empty($_POST['message']) || | |
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) | |
{ | |
echo "No arguments Provided!"; | |
return false; |
This file contains hidden or 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
<!-- CONTACT.HTML --> | |
<form method='post' action='mailform.php'> | |
Email: <input name='email' type='text' /><br /> | |
Subject: <input name='subject' type='text' /><br /> | |
Message:<br /> | |
<textarea name='message' rows='15' cols='40'> | |
</textarea><br /> | |
<input type='submit' /> | |
</form> |
This file contains hidden or 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
<? | |
$to = ""; | |
$from = "" | |
$reply-to = ""; | |
$return-path = "" | |
$cc = ""; | |
$bcc = ""; | |
$subject = ""; | |
$msg = ""; | |
This file contains hidden or 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
'use strict'; | |
/* jshint camelcase: false */ | |
angular.module('lgValidation') | |
// Uses the Guardpost API from MailGun to validation the | |
// email addresses and provide suggestions | |
.directive('lgGuardpost', function($http, $document, | |
MAILGUN_BASE_URL, MAILGUN_API_KEY) { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, ctrl) { |
This file contains hidden or 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
Copyright (c) 2010-2015 Giulia Alfonsi <[email protected]> | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following | |
conditions: |