Skip to content

Instantly share code, notes, and snippets.

View davidmyersdev's full-sized avatar

David Myers davidmyersdev

View GitHub Profile
;(function (window, $)
{
'use strict';
var TheButton = $('#thebutton');
var DesiredTime = parseInt(window.prompt('Enter Your Desired Time: '), 10);
console.log('The Button Will Be Pressed At: ' + DesiredTime + 's');
var RunLoop = window.setInterval(function ()
@davidmyersdev
davidmyersdev / Singleton.php
Created March 10, 2016 20:59
A DRY implementation for the Singleton design pattern in PHP.
<?php
trait Singleton
{
/**
* The instance of our Singleton object.
*/
protected static $instance;
/**
@davidmyersdev
davidmyersdev / LaravelHelpers.md
Last active March 2, 2017 15:44
Scripts and Tips to help with your Laravel project workflow.

Laravel Helpers

Project Setup

Composer Commands

Commands to help the project setup process.

By adding the following script to your composer.json, running composer install will automatically create your .env file and generate a new app key if the file doesn't exist yet (this now runs after the install, because artisan doesn't work until the packages are installed).

Keybase proof

I hereby claim:

  • I am drm2 on github.
  • I am drm2 (https://keybase.io/drm2) on keybase.
  • I have a public key whose fingerprint is C798 26FA 0BE4 F412 6F26 09EC 1452 E930 4B4A D6CB

To claim this, I am signing this object:

An opinionated script to automate the setup process for the Windows Subsystem for Linux.
@davidmyersdev
davidmyersdev / git-carbon-copy
Last active October 8, 2016 15:56
Copy a git repo's files into your own project in one command.
#!/usr/bin/env bash
# @param: <repository> parameter for `git clone <repository>`. For more information, please see https://git-scm.com/docs/git-clone
repository=${1}
# @param: <directory> parameter for `git clone <repository> <directory>`. For more information, please see https://git-scm.com/docs/git-clone
directory=${2}
# @param: (optional) <branch> parameter for `git checkout <branch>`. For more information, please see https://git-scm.com/docs/git-checkout
branch=${3}
@davidmyersdev
davidmyersdev / s.rb
Created November 10, 2017 15:46
A helper method for passing params while expanding Procs.
def s(method, *params)
return Proc.new do |o|
r = o.send(method, *params)
next yield(r) if block_given?
r
end
end
# without helper
[['hello', nil], ['world', 2]].map { |x| x[0].capitalize }.compact # => ["Hello", "World"]
@davidmyersdev
davidmyersdev / git.sh
Created March 7, 2018 23:00
How to do random stuff in Git (including fixing mistakes)
# undo accidental force push to master (or another branch)
git reset --hard origin/master@{1} --

Hi Again!

Good. :)

Set Weight Reps Rest
Set 1 100 (50%) 5 reps 1 minute
Set 2 120 (60%) 5 reps 1 minute
Set 3 140 (70%) 5 reps 2 minutes