Skip to content

Instantly share code, notes, and snippets.

View leotm's full-sized avatar

LeoTM leotm

View GitHub Profile
@YajanaRao
YajanaRao / serviceWorker.js
Last active October 15, 2022 10:10
serviceWorker.js file React Native Web
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: "*"
workflow: tests
workflows:
_tests_setup:
steps:
- activate-ssh-key: {}
@boneskull
boneskull / README.md
Last active November 8, 2023 20:31
user launch agent to update & upgrade Homebrew daily

org.boneskull.homebrew-upgrade

This launch agent will automatically update & upgrade Homebrew every day. Upon success, it will send a notification.

UPDATED Nov 7 2023

Installation

  1. Install Homebrew.
  2. Install terminal-notifier. Execute brew install terminal-notifier.
@sendgrid-gists
sendgrid-gists / v3-hello-email.php
Last active August 9, 2018 17:07
v3 "Hello World" for email, using SendGrid with PHP.
<?php
require 'vendor/autoload.php'; // If you're using Composer (recommended)
// Comment out the above line if not using Composer
// require("<PATH TO>/sendgrid-php.php");
// If not using Composer, uncomment the above line and
// download sendgrid-php.zip from the latest release here,
// replacing <PATH TO> with the path to the sendgrid-php.php file,
// which is included in the download:
// https://github.com/sendgrid/sendgrid-php/releases
@deparkes
deparkes / pizza-price-comparison.py
Last active December 6, 2016 20:20
Pandas plotting of pizza price comparison
# -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
import itertools
# Load data
prices = pd.read_csv("PizzaPrices.csv")
# Filter out an unwanted establishment
prices = prices[(prices['establishment_name'] != "Pizza Zone")]
@geekhunger
geekhunger / page.hbs
Created January 26, 2015 11:14
Ghost - List of posts inside post.hbs and page.hbs
...
{{> posts_list}}
...
@hyharryhuang
hyharryhuang / restartGhost.sh
Created January 1, 2015 14:17
Restart Ghost Blog
sudo service nginx restart
sudo service ghost restart
@milo
milo / github-webhook-handler.php
Last active July 26, 2023 15:29
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 12, 2024 17:44
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)