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).

@edwinheij
edwinheij / streamLargeFile.php
Last active August 20, 2022 22:17
Stream large file with Laravel
<?php
//disable execution time limit when downloading a big file.
set_time_limit(0);
/** @var \League\Flysystem\Filesystem $fs */
$fs = Storage::disk('local')->getDriver();
$fileName = 'bigfile';
$metaData = $fs->getMetadata($fileName);
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@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;
@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
@joshcanhelp
joshcanhelp / scrollTo.js
Last active January 28, 2022 13:21
Animated scrollTo for specific element or top of page
//
// Smooth scroll-to inspired by:
// http://stackoverflow.com/a/24559613/728480
//
module.exports = function (scrollTo, scrollDuration) {
//
// Set a default for where we're scrolling to
//
@mhmoudsami
mhmoudsami / fix wordpress directory and files permision
Created August 18, 2016 17:17
fix wordpress directory and files permision
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@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>
@olivierbellone
olivierbellone / tls_test.php
Created July 28, 2016 09:58
Simple TLS version test for PHP, using howsmyssl.com
<?php
$ch = curl_init('https://www.howsmyssl.com/a/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
echo "<pre>TLS version: " . $json->tls_version . "</pre>\n";