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
name: matching | |
on: | |
push: | |
paths: | |
- "backend/matching/**" | |
- ".github/workflows/matching.yaml" | |
pull_request: | |
jobs: |
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
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
expire & throw a strange error. | |
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |
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
"Just make it with Boostrap & we'll put something better behind it later" | |
How many times have you heard that? Then "later" - if it comes - means going through all of your layouts and views and changing all class names. Of course it's possible that your designer will reuse css framework class names for you, but unlikely and not at all if they are just switching to a different css framework. What to do? | |
My thought is - aliasing. I've always felt (as have others, I've seen) that css frameworks really "do things wrong" in how they force you to tightly couple your elements to their framework. It really defeats the purpose of a separate stylesheet to begin with. So, playing around a little I came up with this experiment. I'm not a designer first - my focus is on the backend stuff - so I'd really appreciate any feedback on the idea. Is this actually practicable? Does it stir the juices and give you a better idea? Please let me know! | |
------ | |
I'm using Sass, but I'm sure you can do something similar with LESS. |
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
<?php | |
/** | |
* Character Limiter | |
* | |
* Limits the string based on the character count. Preserves complete words | |
* so the character count may not be exactly as specified. | |
* | |
* @access public | |
* @param string |
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
public function parse_list($chapters) | |
{ | |
//just a single number passed | |
if (is_numeric($chapters)) return array((int)$chapters); | |
$chapter_array = array(); | |
//break up based on , |
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
$biggest =100; | |
$all_numbers = range(0,$biggest); | |
$threes = array_fill_keys(range(3, $biggest, 3), 'Fizz'); | |
$fives = array_fill_keys(range(5, $biggest, 5), 'Buzz'); | |
$fifteens = array_fill_keys(range(15, $biggest, 15), 'FizzBuzz'); | |
$all_numbers = array_replace($all_numbers, $threes, $fives, $fifteens); | |
var_dump($all_numbers); |
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
WHERE MONTH(FROM_UNIXTIME(cdate)) = '.$month.' AND YEAR(FROM_UNIXTIME(cdate)) = '. $year; |
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
$date = new DateTime((date('Y')-1).'-'.date('m').'-01' ); //to kill the 31 day problem | |
$months_array = array_map(function($val) use ($date) {return $date->add(new DateInterval('P1M'))->format('M');}, range(1,12)); |
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
/* | |
Data starts in table: | |
ProjectId, key, value | |
1 totaltime 02:34:56 | |
1 zip.url http://www.mysite.com/download/file.zip | |
1 zip.size 12MB |
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
<?php | |
$main_object = new main_object(); | |
$main_object->main(); | |
class main_object{ | |
function main() | |
{ |
NewerOlder