Skip to content

Instantly share code, notes, and snippets.

View valmayaki's full-sized avatar
🤠
Happy to be of service to you!

Valentine Ubani Mayaki valmayaki

🤠
Happy to be of service to you!
View GitHub Profile
@heygrady
heygrady / mapDispatchToProps.md
Last active April 5, 2025 08:11
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

// workaround for https://github.com/ionic-team/ionic/issues/13294
// probably breaks iPhone X support
.ios ion-nav > .ion-page > .toolbar.statusbar-padding:first-child,
.ios ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tab > .ion-page > .toolbar.statusbar-padding:first-child,
.ios ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child,
.ios ion-menu > .menu-inner > ion-header > .toolbar.statusbar-padding:first-child {
padding-top: calc(20px + 4px) !important;
@mpijierro
mpijierro / download_csv.php
Last active February 4, 2026 08:45
Example streaming large CSV files with Laravel and thousands of queries
<?php
namespace Src\Csv;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class DownloadLargeCsv
*
@byjg
byjg / NoVNC_Paste.js
Last active May 22, 2025 18:30
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@jgrossi
jgrossi / AttachJwtToken.php
Last active August 14, 2021 18:14
AttachJwtToken.php
<?php
namespace Tests\Concerns;
use App\Models\User;
use Tymon\JWTAuth\Facades\JWTAuth;
trait AttachJwtToken
{
/**
@iWader
iWader / composer.sh
Last active July 23, 2024 07:47
Laravel Unit and Dusk tests on CircleCI 2.0 https://iwader.co.uk/post/laravel-unit-dusk-tests-circleci
#!/bin/sh
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
@joaofeitoza13
joaofeitoza13 / bucketSort.py
Created July 19, 2017 20:38
Bucket Sort python code.
import random
import math
import timeit
import matplotlib.pyplot as plt
timeBubble = []
timeSelection = []
timeInsertion = []
timeQuick = []
timeMerge = []
@calebporzio
calebporzio / $this.sublime-snippet
Created July 6, 2017 14:49
Sublime snippet: $ + tab -> $this->
<snippet>
<content><![CDATA[
\$this->
]]></content>
<tabTrigger>$</tabTrigger>
<scope>embedding.php, meta.embedded.block.php, source.php, meta.class.php, meta.block.php, meta.function.php, meta.block.php</scope>
</snippet>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simple Backbone WordPress Example</title>
<link rel="stylesheet" href="base.css">
</head>
<body>
<ul id="post-list"></ul>
@nicerobot
nicerobot / wait-for-postgres.sh
Created June 27, 2017 14:30
A better wait-for-postgres.sh
#!/bin/bash -e
# wait-for-postgres.sh
# Adapted from https://docs.docker.com/compose/startup-order/
# Expects the necessary PG* variables.
until psql -c '\l'; do
echo >&2 "$(date +%Y%m%dt%H%M%S) Postgres is unavailable - sleeping"
sleep 1
done