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.IO; | |
using System.Security; | |
using System.Security.Cryptography; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace CSEncryptDecrypt | |
{ | |
class Class1 |
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
private void btnCustAdd_Click(object sender, EventArgs e) | |
{ | |
if ((txtCustFirst.Text.Length == 0) || (txtCustFirst.Text == "First") || (txtCustLast.Text.Length == 0) || (txtCustLast.Text == "Last") || (txtCustHouse.Text.Length == 0) || (txtCustHouse.Text == "House") || (txtCustStreet.Text.Length == 0) || (txtCustStreet.Text == "Street") || (txtCustTown.Text.Length == 0) || (txtCustTown.Text == "Town") || (txtCustCounty.Text.Length == 0) || (txtCustCounty.Text == "County") || (txtCustPostcode.Text.Length == 0) || (txtCustPostcode.Text == "Postcode") || (txtCustHPhone.Text.Length == 0) || (txtCustHPhone.Text == "Home") || (txtCustMPhone.Text.Length == 0) || (txtCustMPhone.Text == "Mobile")) | |
{ | |
MessageBox.Show("Please ensure all fields are not null", "Error"); | |
} | |
else | |
{ | |
try |
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
int main() | |
{ | |
std::string input = "abc,def,ghi"; | |
std::istringstream ss(input); | |
std::string token; | |
vector<string> playerInfoVector; | |
while(std::getline(ss, token, ',')) { | |
playerInfoVector.push_back(token); | |
std::cout << token << '\n'; |
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
### Keybase proof | |
I hereby claim: | |
* I am conrjac on github. | |
* I am conrjac (https://keybase.io/conrjac) on keybase. | |
* I have a public key whose fingerprint is 9861 49D6 AE82 A9D9 8222 DA64 05E6 6782 1E14 2E26 | |
To claim this, I am signing this object: |
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
global class DateHelper { | |
public static Date addBussinessDays(Date startDate, Integer iDays) | |
{ | |
Integer businessDaysAdded = 0; | |
Date currentDate = startDate; | |
while (businessDaysAdded < iDays) { | |
currentDate = currentDate.addDays(1); | |
Datetime d = datetime.newInstance(currentDate.year(), currentDate.month(),currentDate.day()); | |
if (d.format('E') != 'Sat' && d.format('E') != 'Sun' && checkifItisWorkingDay(currentDate)) { | |
// it's a business day, so add 1 to the counter that works towards the amount of days to add |
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 class myClass | |
{ | |
MyObject__c.endDateField__c = DateHelper.addBusinessDays(startDateField__c, 10); | |
} |
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
List<Holiday> holidays = new List<Holiday>{new Holiday(Name = 'Good Friday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,03,25)), | |
new Holiday(Name = 'Easter Monday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,03,28) ), | |
new Holiday(Name = 'Early May Bank Holiday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,05,02) ), | |
new Holiday(Name = 'Spring bank holiday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,05,30) ), | |
new Holiday(Name = 'Summer bank holiday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,08,29) ), | |
new Holiday(Name = 'Boxing Day', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,12,26) ), | |
new Holiday(Name = 'Christmas Day (substitute day)', IsAllDay = TRUE, ActivityDate = Date.newInstance(2016,12,27) ), | |
new Holiday(Name = 'New Year’s Day (substitute day)', IsAllDay = TRUE, ActivityDate = Date.newInstance(2017,01,02) ), | |
new Holiday(Name = 'Good Friday', IsAllDay = TRUE, ActivityDate = Date.newInstance(2017,04,14) ), | |
new Holiday(Nam |
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
<project default="document"> | |
<property name="sf.username" value="YOUR USERNAME"/> | |
<property name="sf.password" value="YOUR PASSWORD & YOUR SECURITY TOKEN"/> | |
<target name="document"> | |
<echo message="Generating SchemaSpy documentation (requires Graphviz to be installed to produce diagrams)"/> | |
<delete dir="doc" failonerror="false"/> | |
<java classname="net.sourceforge.schemaspy.Main" fork="true" failonerror="true"> | |
<arg line="-t schemaspy/force"/> | |
<arg line="-db Claims"/> | |
<arg line="-un ${sf.username}"/> |
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
#!/bin/bash | |
USER="BACKUP-USER-ACCOUNT" | |
PASSWORD="BACKUP-USER-PASSOWRD" | |
TIME_STAMP=$(date +%Y-%m-%d-%T) | |
ROOT_BACKUP="BACKUP-LOCATION-ROOT" | |
BACKUP_LOCATION="${ROOT_BACKUP}/${TIME_STAMP}" | |
mkdir -p ${BACKUP_LOCATION} |
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 sendLoggingEMail($subject,$message){ | |
Write-Host "Sending Email" | |
#Exchange Server | |
$exchangeServer = "Exchange Address e.g webmail.domain.tld" | |
#Creating a Mail object | |
$msg = new-object Net.Mail.MailMessage | |
#Creating SMTP server object | |
$smtp = new-object Net.Mail.SmtpClient($exchangeServer) | |
#Email structure | |
$msg.From = "[email protected]" |
OlderNewer