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
| var Promise = require('bluebird'); | |
| var fetchPostById = function(postId){ | |
| return new Promise(function(resolve, reject){ | |
| mySampleAsyncDatabaseFetch(postId, function(err, post){ | |
| if(err){ | |
| reject(err); | |
| } | |
| resolve(post); | |
| }); |
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
| /** | |
| * Created by maximilianalexander on 8/15/14. | |
| */ | |
| angular.module('app').directive('validationMessage', function(){ | |
| return { | |
| restrict: 'E', | |
| templateUrl: 'client/partials/validation-message.html', | |
| scope: { | |
| errorModels: "=", | |
| errorKey: "@" |
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
| apply plugin: 'com.android.application' | |
| android { | |
| compileSdkVersion 21 | |
| buildToolsVersion "21.0.2" | |
| defaultConfig { | |
| applicationId "com.epoqueinc.myapp" | |
| minSdkVersion 15 | |
| targetSdkVersion 21 |
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
| productFlavors { | |
| prod { | |
| packageName "com.mycompany.myapp" | |
| } | |
| dev { | |
| packageName "com.mycompany.myapp.dev" | |
| } | |
| local{ | |
| packageName "com.mycompany.myapp.local" | |
| } |
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
| // In your application, you can retrieve it with getPackageName() | |
| String packageName = getApplicationContext().getPackageName(); | |
| String apiUrl; | |
| if(packageName.equals("com.mycompany.myapp")){ | |
| apiUrl = "myapi.com" | |
| } | |
| if(packageName.equals("com.mycompany.myapp.dev")){ | |
| apiUrl = "dev.myapi.com" | |
| } |
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
| // | |
| // UIColorExtensions.swift | |
| // Eden | |
| // | |
| // Created by Maximilian Alexander on 9/18/15. | |
| // Copyright © 2015 Epoque. All rights reserved. | |
| // | |
| import UIKit |
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
| public static class SaltedHash | |
| { | |
| public static byte[] GenerateSalt() | |
| { | |
| RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); | |
| int minSaltSize = 16; | |
| int maxSaltSize = 32; | |
| Random random = new Random(); | |
| int saltSize = random.Next(minSaltSize, maxSaltSize); | |
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
| public void SendEmail(string fromEmailAddress, string fromName, string fromPassword, string host, int port, | |
| string toEmailAddress, string toName, string subject, string body, bool isHtmlEmail) | |
| { | |
| var fromAddress = new MailAddress(fromEmailAddress, fromName); | |
| var toAddress = new MailAddress(toEmailAddress, toName); | |
| var smtp = new SmtpClient() | |
| { | |
| Host = host, | |
| Port = port, |
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'; | |
| Application.Directives.directive("loadable", function() { | |
| return { | |
| restrict: "A", | |
| templateUrl: "/partials/loading/loadable.html", | |
| transclude: true, | |
| scope: { | |
| loadable: "@" |
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
| app = angular.module 'forms', [] | |
| app.directive 'ngInitial', -> | |
| restrict: 'A' | |
| controller: ['$scope', '$element', '$attrs', '$parse', ($scope, $element, $attrs, $parse) -> | |
| val = $attrs.sbInitial || $attrs.value | |
| getter = $parse($attrs.ngModel) | |
| setter = getter.assign | |
| setter($scope, val) | |
| ] |
OlderNewer