Skip to content

Instantly share code, notes, and snippets.

View josh7weaver's full-sized avatar
👋
Hi!

Joshua Weaver josh7weaver

👋
Hi!
View GitHub Profile
@josh7weaver
josh7weaver / .browserslistrc
Last active June 18, 2019 06:32
Vuejs IE 11 error
> 1%
last 2 versions
not ie <= 10
@josh7weaver
josh7weaver / mysqlBuilder.php
Last active April 22, 2023 07:28
insert on dup key update BULK
<?php namespace [YOUR NAMESPACE HERE];
use Illuminate\Database\Eloquent\Model;
use Log;
use DB;
class MysqlBuilder {
protected $table;
protected $pdoPlaceholderLimit;
@josh7weaver
josh7weaver / resources.md
Last active October 12, 2015 02:32
Recommended Resources

Design and User Experience/Interface

<?php namespace tbb\Auth;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
class CustomUserProvider implements UserProvider {
protected $model;
@josh7weaver
josh7weaver / caller.php
Last active October 1, 2017 11:30
Insert or Update
$valueCollection = [
['ABC - UNDERGRADUATE',"2015ABC",'COMM','COMM 2130','01','11620435234','20','0','2015/08/31 - 2015/12/17','0','1'],
['ABC - UNDERGRADUATE','2015ABC','COMM','COMM 21301','02','11620422234','20','0','2015/08/31 - 2015/12/17','0','1']
];
insertOrUpdate($valueCollection);
@josh7weaver
josh7weaver / driver.rb
Last active August 29, 2015 14:13
Example of Ruby OOP
require "person.rb"
person = Person.new({firstname: 'john', lastname: 'doe'})
puts person.firstname # john
puts person.lastname # doe
# in php it would be person->getFullname();
puts person.fullname # Mr. john doe
# in php its person->setFullname();
@josh7weaver
josh7weaver / DI_example.rb
Last active August 29, 2015 14:13
Ruby Dependency Injection
class Injectable
def can_you_see_me?
puts "SEEN!"
end
end
class Person
attr_accessor :seer
def initialize(seer)
@seer = seer
@josh7weaver
josh7weaver / dateWrapper.php
Created December 23, 2014 22:19
Date Wrapper
class Date{
public $date;
public $timestamp;
private $format = "Y-m-d";
public function __construct($dateString)
{
$this->_setAttrForTimestamp( strtotime($dateString) );
}