Skip to content

Instantly share code, notes, and snippets.

View ssmusoke's full-sized avatar
♻️
In search of green builds

Stephen Senkomago Musoke ssmusoke

♻️
In search of green builds
View GitHub Profile
@PhiloNL
PhiloNL / .env
Last active August 17, 2023 20:21
Simple, fast, and resilient open-source WebSockets server using Soketi with SSL in less than 5 minutes
PUSHER_HOST=socket.yourdomain.com
PUSHER_APP_ID=unlock
PUSHER_APP_KEY=123
PUSHER_APP_SECRET=456
PUSHER_PORT=443
PUSHER_SCHEME=https
@BinaryKitten
BinaryKitten / toRawSql.php
Last active January 22, 2023 21:52
toRawSql.php
<?php
declare(strict_types=1);
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Query\Builder as QueryBuilder;
QueryBuilder::macro(
'toRawSql',
function () {
@adamhopkinson
adamhopkinson / showbreakpoints.blade.php
Created December 7, 2020 16:56
Small TailwindCss component to show which breakpoint is active
<div class="flex space-x-2 mb-4 rounded border text-center text-sm font-bold">
<div class="flex-1 p-2"><span class="text-green-700 mr-1 xs:inline-block sm:hidden">&#x2713;</span><span class="text-red-700 mr-1 hidden sm:inline-block">&#x2717;</span><br>XS</div>
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden sm:inline-block md:hidden">&#x2713;</span><span class="text-red-700 mr-1 inline-block sm:hidden md:inline-block">&#x2717;</span><br>SM</div>
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden md:inline-block lg:hidden">&#x2713;</span><span class="text-red-700 mr-1 inline-block md:hidden lg:inline-block">&#x2717;</span><br>MD</div>
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden lg:inline-block xl:hidden">&#x2713;</span><span class="text-red-700 mr-1 inline-block lg:hidden xl:inline-block">&#x2717;</span><br>LG</div>
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden xl:inline-block 2xl:hidden">&#x2713;</span><span class="text-red-700 mr-1
@luizomf
luizomf / postgresql_13_pgadmin_4_ubuntu_20_04.sh
Last active April 9, 2024 17:27
PostgreSQL 13 on Ubuntu 20.04
# Update all your packages
sudo apt update
sudo apt upgrade -y
# Add postgresql repository and key
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update again
@mrnugget
mrnugget / technical_papers_reading_log_2020.md
Created March 3, 2020 13:51
Technical Papers - Reading Log 2020

Technical Papers

2019

  1. Oct 15: Google's Bigtable paper
  2. Dec 5: "Producing Wrong Data Without Doing Anything Obviously Wrong!" +

2020

  1. Jan 20: "Source Code Rejuvenation is not Refactoring" +
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@mrkpatchaa
mrkpatchaa / git-export-changes-between-two-commits.md
Last active September 29, 2020 03:51
[Git command to export only changed files between two commits] #git

Use case : Imagine we have just created a project with composer create-project awesone-project (currently V0.2). 2 weeks later, there is a new release (V0.3). How to update your project ? Since composer update only updates the project dependencies, it is not what we are looking for. Composer doesn't know about awesome-project since it's not in our composer.json.

After trying many git solutions, I've come to this :

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2 --diff-filter=ACMRTUXB)

This command will check for changes between the two commits and ignore deleted files.

@ghusta
ghusta / Dockerfile
Last active August 12, 2022 20:39
Tomcat 8 + Docker : add custom directory in classpath (Method #1 : modify conf/catalina.properties)
FROM tomcat:8.5-jre8
# $CATALINA_HOME is defined in tomcat image
ADD target/my-webapp*.war $CATALINA_HOME/webapps/my-webapp.war
# Application config
RUN mkdir $CATALINA_HOME/app_conf/
ADD src/main/config/test.properties $CATALINA_HOME/app_conf/
# Modify property 'shared.loader' in catalina.properties
<?php
class Csv
{
public static function fromArray($rows, $delimiter = ',')
{
if (empty($rows)) {
return '';
}

#STEP 1 Create a new laravel project. For more info, check the laravel docs page, on the laravel website

composer create-project laravel/laravel --prefer-dist my-laravel-app

#STEP 3 Install heroku toolbelt, on your machine. Assuming its ubuntu, just follow the following instructions Heroku toolbelt is a command line client, for heroku