Skip to content

Instantly share code, notes, and snippets.

View fgilio's full-sized avatar

Franco Gilio fgilio

View GitHub Profile
@mswieboda
mswieboda / Theming-Slack-OSX.md
Last active December 3, 2017 23:45 — forked from DrewML/Theming-Slack-OSX.md
Theming Slack for OSX 🕶️

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode! 🕶️

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

(I take no credit for this exploit, graciously found via @DrewML https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99 and suggestions by @bradens, @jouni, @gkostov and others).

@pudgereyem
pudgereyem / GIT: Commands
Last active June 15, 2018 09:15
GIT: Useful commands
# If you regret all the changes you've done (in the HEAD)
# Sort of like a huge/massive CMD-Z (undo).
git reset --hard HEAD
### ---
# If you have commited changes, and then end up regretting that,
# because you want to add new changes to that very commit.
# First add files
git add .
@derhuerst
derhuerst / 00-about.md
Last active November 10, 2018 16:16
making asynchronous JS code synchronous

making asynchronous JS code synchronous

This script demonstrates challenges when inlining async function calls like setTimeout as well as a solution.

inspect-code does this.

Things to be solved:

  • setTimeout needs to return a timer id.
  • clearTimeout
@atomkirk
atomkirk / gcloud-function-printenv.sh
Created April 28, 2018 13:06
printenv of google cloud function
X_GOOGLE_FUNCTION_TIMEOUT_SEC=540
X_GOOGLE_FUNCTION_MEMORY_MB=2048
FUNCTION_TIMEOUT_SEC=540
SHLVL=1
FUNCTION_MEMORY_MB=2048
X_GOOGLE_FUNCTION_TRIGGER_TYPE=CLOUD_STORAGE_TRIGGER
PORT=8080
ENTRY_POINT=**********
OLDPWD=/var/tmp/worker/
HOME=/tmp
@thomasgriffin
thomasgriffin / api-helper.php
Last active March 13, 2019 13:46
API Helper to be used during API requests. Should be used as a must-use plugin in WordPress.
<?php
/**
* Plugin Name: TGM API Helper
* Plugin URI: https://thomasgriffin.io
* Description: Whitelists the plugins to be loaded during API requests to reduce overhead.
* Author: Thomas Griffin
* Author URI: https://thomasgriffin.io
* Version: 1.0.0
*/
@tjFogarty
tjFogarty / wiredep.js
Created August 8, 2015 10:52
Gulp + Wiredep + Timber + Twig
var gulp = require('gulp');
var config = require('../config');
var wiredep = require('wiredep').stream;
gulp.task('wiredep', function () {
gulp.src(config.wiredep_file)
.pipe(wiredep({
directory: 'assets/lib',
ignorePath: '..',
fileTypes: {
@mmasashi
mmasashi / creaet_read_only_user.sql
Created November 14, 2016 20:24
Create read-only user on MySQL
CREATE USER r_only_user identified by 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'%' IDENTIFIED BY 'password';
GRANT SELECT, SHOW VIEW, PROCESS, REPLICATION CLIENT ON *.* TO 'r_only_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
@hexsprite
hexsprite / serviceworker-errors.js
Created August 18, 2017 16:00
service worker error tracking example
/* eslint-env browser, serviceworker */
self.addEventListener('error', function (event) {
logError(event.error)
})
self.addEventListener('unhandledrejection', function (event) {
let { reason, detail } = event
if (!reason && detail) {
reason = detail.reason
}
@javan
javan / optimized-screenshots.md
Created July 8, 2019 18:51
macOS: Optimized Screenshots
😱 Before: ~/Desktop/Screen Shot….png 4.1 MB
🏆 After: ~/Screenshots/Screen Shot….png 937 KB

  ⤵

  1. Install https://pngquant.org/
    $ brew install pngquant
@itzikbenh
itzikbenh / home.php
Last active April 5, 2020 09:30
Very simple infinite scroll in WordPress.
//Just a random file for loading your posts to see that the infinite scroll works.
<?php get_header(); ?>
<div class="col-md-6 col-md-offset-3">
<div class="post-container">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="page-header post">
<h1><?php the_title(); ?></h1>
<p><?php the_excerpt(); ?></p>
</div>