Skip to content

Instantly share code, notes, and snippets.

View tcdevs's full-sized avatar

TC Devs tcdevs

  • Technische Centrale
View GitHub Profile
@tcdevs
tcdevs / angularjs-providers-explained.md
Created December 8, 2016 09:20 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@tcdevs
tcdevs / Bootstrap: no blue glow
Created October 26, 2016 11:44 — forked from juliuscsurgo/Bootstrap: no blue glow
Twitter Bootstrap: remove the blue glow in the form inputs
input[type="text"], textarea {
outline: none;
box-shadow:none !important;
border:1px solid #ccc !important;
}
@tcdevs
tcdevs / angular-jqlite.adoc
Created October 24, 2016 13:01 — forked from esfand/angular-jqlite.adoc
Angular jqLite

Angular jqLite

jQuery and Angular

Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite. Still, when Angular detects the presence of a jQuery version in your page, it uses that full jQuery implementation in lieu of jqLite. One direct way in which this manifests itself is with Angular’s element abstraction. For example, in a directive you get access to the element that the directive applies to:

@tcdevs
tcdevs / ngEnter.js
Created August 31, 2016 06:08 — forked from EpokK/ngEnter.js
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
@tcdevs
tcdevs / gist:b31f982bd48945c619b36a8d24993ce1
Created July 12, 2016 13:30 — forked from chad3814/gist:2924672
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "[email protected]"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email
#!/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"]);