Skip to content

Instantly share code, notes, and snippets.

View ReedD's full-sized avatar
🎯
Focusing

Reed Dadoune ReedD

🎯
Focusing
View GitHub Profile
@sjparkinson
sjparkinson / RDS-Aurora-CloudFormation-Example.yaml
Last active May 10, 2022 10:43
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseUsername:
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
@jmillerdesign
jmillerdesign / gist:8602870
Created January 24, 2014 18:13
Fix Messages on Mac when it stops displaying badge notifications and sound
launchctl unload /System/Library/LaunchAgents/com.apple.soagent.plist && launchctl load /System/Library/LaunchAgents/com.apple.soagent.plist && killall Dock
@jmillerdesign
jmillerdesign / tar_over_ssh.sh
Created January 16, 2014 18:36
Useful to move many files (thousands or millions files) over ssh. Faster than scp because this way you save a lot of tcp connection establishments (syn/ack packets).
tar -cf - relative/path/to/dir | gzip -c | ssh user@example.com 'cd ~/path/to/dir; tar xfz -'
# If using a fast lan (I have just tested gigabyte ethernet) it is faster to not compress the data so the command would be:
# tar -cf - relative/path/to/dir | ssh user@example.com 'cd ~/path/to/dir; tar xf -'
@Hexodus
Hexodus / count_total_project_code_lines_in_sublime
Created September 8, 2013 17:06
Count total code lines in project using Sublime texteditor
// Go to menue:
// find->find in files
// Switch on reg_ex button
// Find:
^(.*)$
// Where:
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/*
// Then click on the find button
// Be careful to not click on Replace!!!
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@bngsudheer
bngsudheer / apache-data-transfer-day-report.awk
Created October 27, 2011 14:56
Show data transfer for a given day using Apache's access log file
#!/usr/bin/awk -f
# Usage is
# ./apache-data-transfer-day-report.awk -v date=20/Oct/2011 /path/to/access/log
# Typically, you have an access log file for a domain
# This has been tested only on CentOS 6.
# Fork or ask for a feature or bug fix.
#
BEGIN {
datepart = date
printf ("\nData transfer for the domain for %s:\n", datepart);
@samuel
samuel / check_redis.py
Last active October 19, 2019 11:16
Redis health and memory check for Nagios
#!/usr/bin/python
#
# LICENSE: MIT
#
# Copyright (C) 2014 Samuel Stauffer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation
@marcgg
marcgg / gist:733592
Created December 8, 2010 17:26
Regex to get the Facebook Page ID from a given URL
# Matches patterns such as:
# https://www.facebook.com/my_page_id => my_page_id
# http://www.facebook.com/my_page_id => my_page_id
# http://www.facebook.com/#!/my_page_id => my_page_id
# http://www.facebook.com/pages/Paris-France/Vanity-Url/123456?v=app_555 => 123456
# http://www.facebook.com/pages/Vanity-Url/45678 => 45678
# http://www.facebook.com/#!/page_with_1_number => page_with_1_number
# http://www.facebook.com/bounce_page#!/pages/Vanity-Url/45678 => 45678
# http://www.facebook.com/bounce_page#!/my_page_id?v=app_166292090072334 => my_page_id
# http://www.facebook.com/my.page.is.great => my.page.is.great
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.