Skip to content

Instantly share code, notes, and snippets.

Terrance Smith musicm122

Block or report user

Report or block musicm122

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@musicm122
musicm122 / index.ts
Created May 30, 2019
Typescript Numeric Array Flatten
View index.ts
/*
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4].
Your solution should be a link to a gist on gist.github.com with your implementation.
When writing this code, you can use any language you're comfortable with. The code must be well tested and documented. Please include unit tests and any documentation you feel is necessary. In general, treat the quality of the code as if it was ready to ship to production.
Try to avoid using language defined methods like Ruby's Array#flatten.
Thank you so much!! *
*/
/**
View LinqCSharpExtensions.linq
void Main()
{
// Write code to test your extensions here. Press F5 to compile and run.
}
public static class MyExtensions
{
// Write custom extension methods here. They will be available to all queries.
public static bool IsNumeric(this string theValue)
@musicm122
musicm122 / outlookJournal.vb
Last active Sep 5, 2017
Generate Outlook Daily Journal template
View outlookJournal.vb
Option Explicit
Function GetFormattedCurrentDateString()
GetFormattedCurrentDateString = Format(Now(), "mm/dd/yyyy")
End Function
Function GetFormattedDateString(dateToFormat As Date)
GetFormattedDateString = Format(dateToFormat, "mm/dd/yyyy")
End Function
@musicm122
musicm122 / Twilio.cs
Created Jan 12, 2017
Simple Twilio .net example: Making a call and sending an sms
View Twilio.cs
public static class PhoneApi
{
public static void SendMessage(string messageText, string phoneNumber)
{
var accountSid = "YourAccountSid"; // Your Account SID from www.twilio.com/console
var authToken = "YourAuthToken"; // Your Auth Token from www.twilio.com/console
var fromNumber = "+Your From Number";
var twilio = new TwilioRestClient(accountSid, authToken);
var message = twilio.SendMessage(fromNumber, phoneNumber, messageText);
}
@musicm122
musicm122 / Solution.cs
Created Jan 10, 2017
FSharpKoansStock_In_CSharp
View Solution.cs
//https://github.com/ChrisMarinos/FSharpKoans/blob/fsharp/FSharpKoans/AboutTheStockExample.fs#L34
void Main()
{
var result1 = Sol1(stockData);
var result2 = Sol2(stockData.Skip(1).ToArray());
result1.Dump();
result2.Dump();
}
public class Row
@musicm122
musicm122 / ExportAndFormatting.cs
Created Dec 9, 2016
Using Scorm Extensions for Export and Formatting
View ExportAndFormatting.cs
public async Task<string> GetCoursesAsCSV()
{
var appId = "Your Application Id";
var secretKey = "Your Secret Key";
var scormServiceUrl = "https://cloud.scorm.com/EngineWebServices/";
ScormCloud.Configuration = new Configuration(scormEngineServiceUrl: scormServiceUrl, appId: appId, securityKey: secretKey, origin: "");
var result = await ScormCloud.CourseService.GetCourseDetailListAsync();
return result.ToCSVString();
@musicm122
musicm122 / UsingScormExtension.cs
Created Dec 9, 2016
Example of how to use scorm extensions
View UsingScormExtension.cs
public async Task<List<CourseData>> GetCourses()
{
var appId = "Your App Id";
var secretKey = "Your Secret Key";
var scormServiceUrl = "https://cloud.scorm.com/EngineWebServices/";
ScormCloud.Configuration = new Configuration(scormEngineServiceUrl: scormServiceUrl, appId: appId, securityKey: secretKey, origin: "");
var result = await ScormCloud.CourseService.GetCourseDetailListAsync();
return result;
@musicm122
musicm122 / index.html
Created Nov 27, 2016
Uploading a file to S3 in node.js
View index.html
<html>
<body>
<form method="POST" action="/upload" enctype="multipart/form-data">
<div class="field">
<label for="image">Image Upload</label>
<input type="file" name="image" id="image">
</div>
<input type="submit" class="btn" value="Save">
</form>
</body>
View keybase.md

Keybase proof

I hereby claim:

  • I am musicm122 on github.
  • I am hackerferret (https://keybase.io/hackerferret) on keybase.
  • I have a public key whose fingerprint is 42B4 D341 1CFB CF1F 29F3 61D2 8D8B A9AA 8B5F 6E5F

To claim this, I am signing this object:

View FSharpKoansStock.fs
open System
open System.Globalization
//---------------------------------------------------------------
// Apply Your Knowledge!
//
// Below is a list containing comma separated data about
// Microsoft's stock prices during March of 2012. Without
// modifying the list, programatically find the day with the
// greatest variance between the opening and closing price.
//
You can’t perform that action at this time.