Skip to content

Instantly share code, notes, and snippets.

@samuelcastle
samuelcastle / cloudformation-eb-apidestinations-demo.yaml
Last active April 18, 2021 08:20
Amazon EventBridge API Destinations demo - Cloudformation template
AWSTemplateFormatVersion: 2010-09-09
Parameters:
MailchimpMembersUrl:
Type: String
Default: https://xxx.api.mailchimp.com/3.0/lists/230948/members
MailchimpApiPassword:
Type: String
Default: REPLACEME
@therightstuff
therightstuff / RSAKeys.cs
Last active November 3, 2023 16:34
Import and export RSA Keys between C# and PEM format using BouncyCastle
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Security;
using System;
using System.IO;
using System.Security.Cryptography;
namespace MyProject.Data.Encryption
{
function averageSalary(employees: Employee[], conditions: Predicate[]): number {
let total = 0;
let count = 0;
employees.forEach((e) => {
if(conditions.every(c => c(e))){
total += e.salary;
count += 1;
}
});
//for a dynamically loaded application
// <script src="system.js">
// <script src="system.config.js">
// <script>
// System.import('app');
// </script>
//for a prebuilt app
var Builder = require('systemjs-builder');
@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
@jackofseattle
jackofseattle / injectable.js
Last active August 29, 2015 14:07
Basic injectable class for AngularJS
/**
* injectable
*
* Provides a constructor to move items from the $inject property to local object members.
*
* inject = ['$q', '$http'] //translates to
*
* this.$q
* this.$http
*/
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
@lrvick
lrvick / app.js
Last active April 26, 2024 13:06
AngularJS credit card form with validation
// MIT: http://opensource.org/licenses/MIT
angular.module('app', []);
angular.module('app').controller
( 'MainCtrl'
, function($scope,$locale) {
$scope.currentYear = new Date().getFullYear()
$scope.currentMonth = new Date().getMonth() + 1
$scope.months = $locale.DATETIME_FORMATS.MONTH
@jelbourn
jelbourn / api-provider.js
Last active February 25, 2024 12:51
Example of using an angular provider to build an api service. Subject of August 20th 2013 talk at the NYC AngularJS Meetup. http://www.meetup.com/AngularJS-NYC/events/134578452/See in jsbin: http://jsbin.com/iWUlANe/5/editSlides: https://docs.google.com/presentation/d/1RMbddKB7warqbPOlluC7kP0y16kbWqGzcAAP6TYchdw
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn (@jelbourn)
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/