Skip to content

Instantly share code, notes, and snippets.

View tcdevs's full-sized avatar

TC Devs tcdevs

  • Technische Centrale
View GitHub Profile
#!/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')
@tcdevs
tcdevs / angular-jsonDate.js
Created March 1, 2016 08:33 — forked from kwokhou/angular-jsonDate.js
AngularJS filter to format ASP.NET JSON Date
// 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)));
@tcdevs
tcdevs / anchor_smooth_scroll.js
Created December 4, 2015 09:15 — forked from justinmc/anchor_smooth_scroll.js
Anchor Smooth Scroll - Angular Directive
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 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,
@tcdevs
tcdevs / mail.php
Created November 13, 2015 14:31 — forked from namontec/mail.php
ajax send mail php
<?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"]);
<?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;
@tcdevs
tcdevs / php-mail-form.php
Created November 13, 2015 08:42 — forked from louismullie/php-mail-form.php
PHP Mail Form
<!-- 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>
@tcdevs
tcdevs / sendMail.php
Created November 13, 2015 07:28 — forked from sptrsn/sendMail.php
mail()
<?
$to = "";
$from = ""
$reply-to = "";
$return-path = ""
$cc = "";
$bcc = "";
$subject = "";
$msg = "";
@tcdevs
tcdevs / lgGuardpost.js
Created November 12, 2015 13:40 — forked from laurentgoudet/lgGuardpost.js
MailGun's Guardpost email validation directive for AngularJS - How to create Async directives with $validators in Angular >= v1.3.0-beta.16
'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) {
@tcdevs
tcdevs / LICENSE-MIT
Created November 6, 2015 14:56 — forked from electricg/LICENSE-MIT
Stopwatch in javascript
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: