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
| //From http://www.josscrowcroft.com/2011/code/format-unformat-money-currency-javascript/ | |
| // Extend the default Number object with a formatMoney() method: | |
| // usage: someVar.formatMoney(decimalPlaces = 2) | |
| Number.prototype.formatMoney = function (places) { | |
| places = !isNaN(places = Math.abs(places)) ? places : 2; | |
| thousand = ","; | |
| decimal = "."; | |
| var number = this, | |
| i = parseInt(number = Math.abs(+number || 0).toFixed(places), 10) + "", | |
| j = (j = i.length) > 3 ? j % 3 : 0; |
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
| body | |
| { | |
| /* GitHub */ | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
| /* Zeit.co */ | |
| font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif; | |
| /* Solid.systems */ | |
| /* Serif */ |
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
| <table> | |
| <tr> | |
| <td bgcolor="chucknorris" width="100" height="30"></td> | |
| <td bgcolor="mrt" width="100"></td> | |
| <td bgcolor="ninjaturtle" width="100"></td> | |
| </tr> | |
| <tr> | |
| <td bgcolor="sick" width="100" height="30"></td> | |
| <td bgcolor="crap" width="100"></td> | |
| <td bgcolor="grass" width="100"></td> |
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
| function a(callback) | |
| { | |
| console.log("a"); | |
| callback(); | |
| } | |
| function b(callback) | |
| { | |
| console.log("b"); | |
| callback(); |
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
| using System; | |
| using System.Diagnostics; | |
| namespace SteGriff.Utilities | |
| { | |
| public class ProcessReader | |
| { | |
| public static string StartProcessAndGetOutput(string filename, string args = "") | |
| { | |
| ProcessStartInfo startInfo = new ProcessStartInfo() |
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 Module ProcessReader | |
| Public Function StartProcessAndGetOutput(filename As String, Optional args As String = "") As String | |
| Dim startInfo As New ProcessStartInfo() With { _ | |
| .CreateNoWindow = True, _ | |
| .RedirectStandardOutput = True, _ | |
| .RedirectStandardInput = True, _ | |
| .UseShellExecute = False, _ | |
| .Arguments = args, _ |
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
| //Run me with cscript.exe | |
| //Thanks https://gist.github.com/duncansmart/5821523 | |
| //Create easy reference to stdout for logging | |
| var Console = WScript.StdOut; | |
| //Create XHR object | |
| var xhr = WSH.CreateObject("Microsoft.XMLHTTP"); | |
| var url = "http://www.some-url-to-ping/api/initialise"; |
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
| <!DOCTYPE HTML> | |
| <html ng-app> | |
| <head> | |
| <title>Tiny Angular Pangram App</title> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| <style> | |
| .spare{color:red;} | |
| .used{text-decoration:line-through; color:blue;} | |
| .w-100{width:100%;} | |
| </style> |
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
| -- Add column to table | |
| if not exists ( | |
| select * | |
| from sys.columns | |
| where object_id = OBJECT_ID('MyTable') | |
| and name = 'MyNewColumn' | |
| ) | |
| begin | |
| alter table MyTable | |
| add MyNewColumn nvarchar(20) null |
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
| 'VBA | |
| ' Results: | |
| ' 1 is truthy but not equal to True | |
| ' -1 is truthy and == True | |
| ' 0 is falsy and == False | |
| ' "True" is truthy and == True | |
| ' "False" is falsy and == False | |
| Public Sub Test() | |
| If "True" Then |