Skip to content

Instantly share code, notes, and snippets.

View Fredegaard's full-sized avatar

Christian Fredegaard Fredegaard

View GitHub Profile
@kenjis
kenjis / _autocomplete.php
Created April 12, 2012 02:13
FuelPHP 1.2 helperfile for IDE code completion
<?php
class Asset_Instance extends Fuel\Core\Asset_Instance {}
class Cache_Handler_Json extends Fuel\Core\Cache_Handler_Json {}
class Cache_Handler_Serialized extends Fuel\Core\Cache_Handler_Serialized {}
class Cache_Handler_String extends Fuel\Core\Cache_Handler_String {}
class Cache_Storage_Apc extends Fuel\Core\Cache_Storage_Apc {}
abstract class Cache_Storage_Driver extends Fuel\Core\Cache_Storage_Driver {}
class Cache_Storage_File extends Fuel\Core\Cache_Storage_File {}
class Cache_Storage_Memcached extends Fuel\Core\Cache_Storage_Memcached {}
@plentz
plentz / nginx.conf
Last active July 23, 2026 11:59
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@donniebrandt
donniebrandt / timezones.sql
Last active November 2, 2018 23:32
MySQL: Timezones.
CREATE TABLE `options` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`group` enum('Timezones') COLLATE utf8_unicode_ci NOT NULL,
`order` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`name`,`group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `options` (`name`, `group`, `order`)
VALUES
("Africa/Abidjan", 'Timezones', 0),
@jaw-sh
jaw-sh / cloudflare.sh
Last active October 17, 2020 08:29
Bash file to pull Cloudflare IPs from their API endpoints. Can be used in CRON jobs.
#!/bin/bash
# Author: Joshua Moon <josh@jaw.sh>
# Date: 14-May-2016
# Purpose: Creates an up-to-date Cloudflare nginx config file.
# License: MIT
################################################################################
# INSTRUCTIONS
@troyfontaine
troyfontaine / 1-setup.md
Last active August 13, 2026 03: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.

@danhunsaker
danhunsaker / README.md
Last active December 15, 2019 23:38 — forked from sanderson/Environment Variables
Configuring Nanobox to Use nullmailer

nullmailer and Nanobox

Start by adding the environment variables (below) to your app, and merging the boxfile.yml entries into your own boxfile.yml. The script, here, is pulled in automatically by the git.io shortlink in the transform hook, so you don't need to add that.

Environment Variables

The values of the various evars should be provided by your SMTP service

@argentinaluiz
argentinaluiz / command
Created November 12, 2018 16:25
cmder no PHPStorm, Pycharm, etc
"cmd.exe" /k set CMDER_ROOT=C:\cmder&&set ConEmuDir=%CMDER_ROOT%\vendor\conemu-maximus5&&call "%CMDER_ROOT%\vendor\init.bat"
@mysiar
mysiar / ideolog-monolog.md
Created February 22, 2019 18:15
Monolog template for Ideolog
Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
@christophengelmayer
christophengelmayer / tailwind-resonsive-embed.html
Last active September 10, 2024 11:52
Tailwind CSS responsive Video embed
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube-nocookie.com/embed/FMrtSHAAPhM" frameborder="0" …></iframe>
</div>
@reinink
reinink / query.sql
Last active November 14, 2023 11:08
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or