Skip to content

Instantly share code, notes, and snippets.

View martincarlin87's full-sized avatar
💻

Martin Carlin martincarlin87

💻
View GitHub Profile
@adamwathan
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
Promise.takeAtLeast
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
@allotmentandy
allotmentandy / laravelDuskArticle
Last active June 7, 2017 14:46
laravel dusk article - hidden dusk features
source for dusk
https://github.com/laravel/dusk
pressing the return key
https://laravel.com/docs/5.4/dusk#using-the-keyboard
i wanted to add a line to the dusk docs to say this is how you press return as it isnt clear to me
->keys('.btn', ['{RETURN_KEY}', '']);
making screendump at that point in the test
->screenshot('rssFeedPopup');
@simonhamp
simonhamp / AppServiceProvider.php
Last active May 16, 2024 09:04
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@gskema
gskema / BulkInsertQuery.php
Last active November 4, 2023 10:56
PHP PDO / Doctrine DBAL bulk insert query
<?php
namespace YourApp\Repository\Query;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Identifier;
/**
* Class BulkInsertQuery
*
@ramon-villain
ramon-villain / ThemosisValetDriver.php
Created January 29, 2017 15:55
Themosis Valet Driver
<?php
class ThemosisValetDriver extends BasicValetDriver
{
/**
* Mutate the incoming URI.
*
* @param string $uri
* @return string

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@tliesnham
tliesnham / CoasterValetDriver.php
Last active August 10, 2017 14:02
Fixes the Responsive Filemanager when running a Coaster project locally with Laravel Valet.
<?php
class CoasterValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
form[data-drip-embedded-form] {
background: #fff url(data:image/gif;base64,R0lGODlhAQADAIABAMzMzP///yH/C1hNUCBEYXRhWE1QPD94cGFja…wbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAABAAMAAAICRFIAOw==) repeat-y center top;
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
line-height: 1.5em;
overflow: hidden;
color: #666;
font-size: 16px;
border-top: solid 20px #3071b0;
border-top-color: #3071b0;
border-bottom: solid 10px #3d3d3d;
@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@leonardofed
leonardofed / README.md
Last active June 10, 2024 15:36
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.