{{ message }}

Instantly share code, notes, and snippets.

🐧
• • • • • •

🐧
• • • • • •
Created Jul 26, 2018
View myip.sh
 #!/bin/bash # Displays my ip addresses ifconfig | grep "inet " | cut -f2 -d " "
Created Jul 13, 2018
C# Grabbing a Control from a UserControl that's somewhere in a MasterPage
View FindControlRecursive.cs
 // Digs through the control hierarchy starting at a root control // stopping when the ID matches private static Control FindControlRecursive(Control root, string id) { if (root.ID == id) return root; foreach (Control control in root.Controls) {
Created Jan 17, 2018
Largest whole number less than 2007 that's divisible by 2, 3, 4, 5, 6, and 7
View nicks_math_problem.js
 // My 11 year old's 6th grade homework one day: https://pbs.twimg.com/media/DLVjmkXUEAAF2_D.jpg // Problem of the Week: Find the largest whole number less than 2007 that is divisible by 2, 3, 4, 5, 6, and 7. // He wrote down 1680 and wanted me to check to see if he was right. // Checked it the easiest way I knew. for (var i = 2007; i > 0; i--) if (i % 7 == 0) if (i % 6 == 0) if (i % 5 == 0) if (i % 4 == 0)
Created Dec 20, 2017
View replaceCharAt.js
 String.prototype.replaceCharAt = function (index, character) { return this.substr(0, index) + character + this.substr(index + character.length); }
Created Dec 20, 2017
View isAnagram.js
 function isAnagram(phrase1, phrase2) { return phrase1.split("").sort().join("") === phrase2.split("").sort().join(""); }
Created Dec 6, 2017
View CalculateNumberOfWorkDays.sql
 /* Calculates the difference between dates excluding weekends */ ALTER FUNCTION [dbo].[CalculateNumberOfWorkDays] (@StartDate datetime, @EndDate datetime) RETURNS int AS BEGIN SET @StartDate = DATEADD(dd, DATEDIFF(dd, 0, @StartDate), 0) SET @EndDate = DATEADD(dd, DATEDIFF(dd, 0, @EndDate), 0)
Created Mar 3, 2017
macOS - Disable Screen Capture Drop Shadows