Skip to content

Instantly share code, notes, and snippets.

View tfirdaus's full-sized avatar
👨‍💻

Thoriq Firdaus tfirdaus

👨‍💻
View GitHub Profile
@troyfontaine
troyfontaine / 1-setup.md
Last active April 24, 2024 14:19
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@hakre
hakre / other.php
Created June 18, 2017 23:50
inject php declare ticks poc
<?php
/**
* just some file
*/
$a = 1;
if ($a > 0) {
$a += 2;
print($a);
@santerref
santerref / autoload.php
Last active October 18, 2016 10:11
WordPress autoloader that respects PHP coding standards for plugin.
<?php
spl_autoload_register( function ( $class ) {
// project-specific namespace prefix
$prefix = 'my_plugin\\';
// base directory for the namespace prefix
$base_dir = __DIR__ . '/includes/';
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active March 5, 2024 20:45
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@denji
denji / nginx-tuning.md
Last active May 1, 2024 22:58
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@DrewAPicture
DrewAPicture / gist:6141436
Last active December 20, 2015 13:48
Post Formats + other removed functions and filters in 3.6
http://codex.wordpress.org/Function_Reference/get_attached_audio
http://codex.wordpress.org/Function_Reference/get_attached_video
http://codex.wordpress.org/Function_Reference/get_attached_images
http://codex.wordpress.org/Function_Reference/get_attached_image_srcs
http://codex.wordpress.org/Function_Reference/get_content_media
http://codex.wordpress.org/Function_Reference/get_content_audio
http://codex.wordpress.org/Function_Reference/get_content_video
http://codex.wordpress.org/Function_Reference/get_content_images
http://codex.wordpress.org/Function_Reference/get_content_image
http://codex.wordpress.org/Function_Reference/get_content_galleries
@boogah
boogah / wp_mysql_optimizations.sql
Last active April 20, 2017 20:32
Common database optimizations for WordPress sites.
/* Delete revisions */
DELETE FROM wp_posts WHERE post_type = "revision";
/* Only use this if you no longer care about any of your current revisions! */
/* Delete trashed posts */
DELETE FROM wp_posts WHERE post_type = "trash";
/* Delete Jetpack Feedback Spam */
SELECT * FROM wp_posts WHERE wp_posts.post_type = "feedback" AND wp_posts.post_status= "spam";
@mynameispj
mynameispj / Props
Created July 24, 2012 14:55
Estimated reading time in PHP, by Brian Cray
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/
@danott
danott / modernizr-tests.js
Created March 4, 2011 16:55
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/