Skip to content

Instantly share code, notes, and snippets.

View dfdemar's full-sized avatar

David DeMar dfdemar

  • Roswell, Georgia
View GitHub Profile
public class Main
{
public static List<Integer> primes = new ArrayList<Integer>();
public static void main(String[] args)
{
findPrimes(100);
for(int prime : primes)
System.out.println(prime);
@dfdemar
dfdemar / gist:6001955
Last active December 19, 2015 18:49
Palindrome detector
using System;
public class Test
{
public static void Main()
{
Console.WriteLine(IsPalindrome("amanaplanacanalpanama"));
}
public static bool IsPalindrome(string word)
' David DeMar
' [email protected]
Sub FormatData()
'
' FormatData Macro
' Removes merged cells and wrapped text from the Payroll Summary report and checks that all employees are included in the allocations sheet
'
'
@dfdemar
dfdemar / align-commit-dates.sh
Last active October 14, 2024 15:54
Sets the committer date to the author date for every commit in a git branch
#!/bin/bash
# Get the current branch name
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Get the first commit on the current branch that is not on the main branch
FIRST_COMMIT=$(git rev-list main..${BRANCH} --reverse | head -1)
# Change the committer date to the author date for all commits from the first commit to the current branch
git filter-branch -f --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' \