This file contains 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
<script> | |
// This function will allow 0123456789, left, right, and backspace on a textbox | |
// Use onkeypress="return isNumericKeyPress(event.keyCode);" to trigger | |
function isNumericKeyPress(keyCode) | |
{ | |
return (keyCode >= 48 && keyCode <= 57 || keyCode === 8); | |
} | |
// This function will clear non-numeric values on a textbox when pasted | |
// Use onpaste="isNumericPaste(this);" to trigger |
This file contains 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
<script> | |
function formatCurrency() | |
{ | |
// Get the values from the text-boxes | |
var symbol = document.getElementById('formatCurrencySymbol').value; | |
var number = parseFloat(document.getElementById('formatCurrencyNumber').value); | |
var decimalPlaces = document.getElementById('formatCurrencyDecimalPlaces').value; | |
// Do the formatting - Regex here! | |
var result = symbol + number.toFixed(decimalPlaces).replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); |
This file contains 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 | |
function reverseString(str) | |
{ | |
str = str.split("").reverse().join(""); | |
alert(str); | |
} | |
// Button onclick event | |
reverseString('I want to be reversed :D'); |
This file contains 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 | |
function stripChars(myWord) | |
{ | |
myWord = myWord.replace(/[^\w\s]/gi, ""); | |
alert(myWord); | |
} | |
// Button onclick event | |
stripChars('Hello!@!@%!@^! 5u*&%@p3r Wor(&(+)+l;d!!'); |
This file contains 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 [master] | |
GO | |
CREATE DATABASE [insert_database_name_here] ON | |
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\fileNameHere.mdf' ), | |
FOR ATTACH ; | |
GO |
This file contains 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
<script> | |
// This is a comment | |
function someFunc() | |
{ | |
console.log("Hello World!"); | |
} | |
</script> |
This file contains 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
/* Gist Embed - Dark Theme Styling - Thanks to MattD */ | |
/* Body */ | |
.gist-data tbody { background-color: Black; } | |
/* Line Numbers */ | |
.gist-data tbody td:nth-of-type(1) { | |
color: #2B91AF !important; | |
} |
This file contains 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
<script> | |
function formatCurrency() | |
{ | |
// Get the values from the text-boxes | |
var symbol = document.getElementById('formatCurrencySymbol').value; | |
var number = parseFloat(document.getElementById('formatCurrencyNumber').value); | |
var decimalPlaces = document.getElementById('formatCurrencyDecimalPlaces').value; | |
// Do the formatting - Regex here! | |
var result = symbol + number.toFixed(decimalPlaces).replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); |
This file contains 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
private static void Main() | |
{ | |
int num1 = 2; | |
double num2 = 4; | |
var someString2 = $"{num2 / int.Parse($"{num2}") + $"_{num1}" + $"Meta{num2 / int.Parse($"{num2}") + $"_{num2 % num1 % int.Parse($"{num2}")}"}M{null}eta_{num2}Me"}"; | |
Console.WriteLine(someString2); | |
Console.ReadLine(); | |
} |
OlderNewer