Skip to content

Instantly share code, notes, and snippets.

View geerlingguy's full-sized avatar
:shipit:
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

:shipit:
Tea, Earl Grey, hot.
View GitHub Profile
@thebigreason
thebigreason / social-sharing-alignment.html
Created October 18, 2011 17:48
Align Facebook Like, Twitter Tweet and Google +1 buttons
<div class="social">
<span class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="[your-url-here]">Tweet</a>
</span>
<span class="google">
<g:plusone size="medium" href="[your-url-here]"></g:plusone>
</span>
<span class="Facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=[your-url-here]&amp;show_faces=false&amp;layout=button_count" scrolling="no" frameborder="0" style="height: 21px; width: 100px" allowTransparency="true"></iframe>
</span>
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@CashWilliams
CashWilliams / drupal.cow
Created August 8, 2012 20:19
Drupal cowsay
$the_cow = <<"EOC";
$thoughts ..Z..
$thoughts .7,#8
$thoughts ...Z.=###..
..=.=Z######Oo..
..N. .~+###########~.
..8. ..~7##############8.
..?.. .~~##################D.
... ..+=#Z####################~.
? ....~=#########################8.
@jakebellacera
jakebellacera / how-to-install-memcache-on-mamp-2.md
Last active July 4, 2021 16:09
How To Install Memcache on MAMP 2

How To Install Memcache on MAMP 2

Note: This is an old guide and may not work for newer versions of macOS. Please see comments below for additional steps.

  1. Install memcached. I'd suggest using homebrew. brew install memcached
  2. Select your desired version of PHP that you'd like to use in MAMP. This dropdown is located in the PHP tab in MAMP PRO.
  3. Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
  4. Extract the source into /Applications/MAMP/bin/php/[php version folder]/include/php.
  5. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
  6. /Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache.
@geerlingguy
geerlingguy / apple-tv-status.php
Last active March 4, 2021 22:41
Simple script to use the Ping PHP library and print a list of servers and their statuses. Written for a school that needs to track whether some local Apple TVs are active.
<?php
/**
* @file
* Show the status of various Apple TVs.
*/
// Place Ping.php in the same folder as this script.
require_once('Ping.php');
@geerlingguy
geerlingguy / SonarDrupalKeyGenerator.php
Last active January 30, 2024 16:47
A simple PHP script to generate the XML necessary for Sonar to detect the Drupal Coder module's sniffs. See: https://drupal.org/node/2082563
<?php
/**
* @file
* Generate rules for Drupal Coding Standards Sniffs.
*
* SonarQube requires manually-entered PHP CodeSniffer rules if you use anything
* outside of the standard set of rules. In this case, there are a bunch of
* Drupal-specific sniffs that we'd like to use.
*
anonymous
anonymous / night-before-opsmas.txt
Created December 24, 2013 07:19
Twas the night before Opsmas..
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@phantomwhale
phantomwhale / Command Line
Created March 20, 2014 04:14
Passing command line arguments into Vagrant to configure Ansible Provisioning
# with a space, this doesn't work...
$ ANSIBLE_ARGS='-t elasticsearch' vagrant provision
==> default: Running provisioner: ansible...
ERROR: tag(s) not found in playbook: elasticsearch. possible values: apache,common,elasticsearch,java,passenger,postgresql,ruby
Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.
# without the space, it now works...
$ ANSIBLE_ARGS='-telasticsearch' vagrant provision
@phips
phips / hosts.yml
Last active August 2, 2021 19:59
Ansible setting of hostname from inventory, but ignoring IP addresses
- name: Ensure hostname set
hostname:
name: {{ inventory_hostname }}
when: not inventory_hostname|trim is match('(\d{1,3}\.){3}\d{1,3}')
- name: Ensure hostname is in /etc/hosts
lineinfile:
dest: /etc/hosts
regexp: "^{{ ansible_default_ipv4.address }}.+$"
line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}"