Skip to content

Instantly share code, notes, and snippets.

@Moligaloo
Moligaloo / DefaultFontFallbacks.plist
Created July 26, 2012 05:57
The plist to replace default font of Mac OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- default ordered fallback list - fallback entity has to be PostScript name -->
<key>default</key>
<array>
<string>LucidaGrande</string> <!-- MAKE sure this matches the kCTFontSystemFontType in CTFontDescriptorCreateForUIType() & TDescriptorSourceImp::CreateDefaultDescriptor()! -->
<string>AppleSymbolsFB</string>
<string>GeezaPro</string>
@audreyt
audreyt / posa.mkdn
Last active October 12, 2021 01:06
EtherCalc Chapter for the upcoming book "The Performance of Open Source Applications" - Draft - comments welcome!

From SocialCalc to EtherCalc

Previously, in The Architecture of Open Source Applications, I described SocialCalc, an in-browser spreadsheet system that replaced the server-centric WikiCalc architecture. SocialCalc performs all of its computations in the browser; it uses the server only for loading and saving spreadsheets.

For the Socialtext team, performance was the primary goal behind SocialCalc's design in 2006. The key observation was this: Client-side computation in JavaScript, while an order of magnitude slower than server-side computation in Perl, was still much faster than the network latency incurred during AJAX roundtrips:


WikiCalc and SocialCalc's performance model

******
@sergejmueller
sergejmueller / .htaccess
Last active October 9, 2024 00:33
Apache: Detecting WebP support with Header Vary Accept
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active November 4, 2024 16:00
A better markdown cheatsheet.
@jnovack
jnovack / README.md
Last active April 3, 2024 03:24
Opening up mosh in firewalld using firewall-cmd

Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.

I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.

  1. Create the following file as /etc/firewalld/services/mosh.xml
  2. firewall-cmd --add-service=mosh --permanent
  3. firewall-cmd --reload

If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active October 16, 2024 08:37
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@reigelgallarde
reigelgallarde / woocommerce_product_tabs_contact_form7.php
Last active February 27, 2017 20:35
WooCommerce Additional Tab Product Inquiry.
<?php
/**
* Plugin Name: WooCommerce plus Contact Form 7
* Plugin URI: http://reigelgallarde.me/plugins/how-to-add-inquiry-tab-to-your-product-in-woocommerce-using-contact-form-7
* Description: Additional Tab Product Inquiry.
* Author: Reigel Gallarde
* Author URI: http://reigelgallarde.me
* Version: 0.1
* Tested up to: 4.1
*
@johanneswseitz
johanneswseitz / gist:94810bfafc786f3ec404
Last active February 15, 2017 15:36
Disable Adware installation for Mac Java 8u40+
sed -i "" 's/install.disable.sponsor.offers.*/install.disable.sponsor.offers=true/g' ~/Library/Application\ Support/Oracle/Java/Deployment/deployment.properties
defaults write ~/Library/Application\ Support/JREInstaller/ThirdParty SPONSORS -string "0"
@vicendominguez
vicendominguez / ansible-linode-template.yml
Last active August 7, 2017 13:21
Ansible Linode template (tested and working)
#### CentOS: yum install pip ; pip install linode-python ; pip install chube
####
- hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create linode server
linode:
api_key: '---LINODE-API-KEY-HERE---'
@prasadnevase
prasadnevase / bacs-account-shortcode.php
Last active July 10, 2020 11:29
WooCommerce - Shortcode to list BACS accounts on checkout page
<?php
/* Usage: Put [bacs_account_details] shortcode in "WooCommerce > Settings > Checkout > BACS > Description field" */
/* This function outputs the BACS account details */
function list_bacs_accounts() {
$accounts = get_option( 'woocommerce_bacs_accounts');
if ( $accounts ) {
$list_accounts = '<table>
<thead>