Skip to content

Instantly share code, notes, and snippets.

View gegere's full-sized avatar

Jason Gegere gegere

View GitHub Profile
@PeteMall
PeteMall / linkify-urls.php
Created October 28, 2010 22:52
WordPress Plugin to converts URLs in the post content to links.
<?php
/*
Plugin Name: Linkify URLs
*/
add_filter( 'the_content', 'linkify_urls' );
function linkify_urls( $content ){
return preg_replace( '/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '<a href="$0">$0</a>', $content );
}
@chrisvanpatten
chrisvanpatten / jquery.fullscreenr.js
Created December 22, 2011 20:54
jQuery Fullscreenr
/**
* Fullscreenr - lightweight full screen background jquery plugin
* By Jan Schneiders
* www.nanotux.com
*
* Modifications by Chris Van Patten
* http://www.vanpattenmedia.com
* Version 1.5
**/
@hubgit
hubgit / twitter-oauth-pecl.php
Created May 20, 2010 17:58
Command line Twitter OAuth authentication in PHP
<?php
// Register an app: http://dev.twitter.com/apps
define('CONSUMER_KEY', 'YOUR CONSUMER KEY');
define('CONSUMER_SECRET', 'YOUR CONSUMER SECRET');
define('TWITTER_TOKEN', '');
define('TWITTER_TOKEN_SECRET', '');
$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);

Write a function that counts how many different ways you can make change for an amount of money, given an array of coin denominations. For example, there are 3 ways to give change for 4 if you have coins with denomination 1 and 2:

1+1+1+1, 1+1+2, 2+2. The order of coins does not matter:

1+1+2 === 2+1+1 Also, assume that you have an infinite ammount of coins.

Your function should take an amount to change and an array of unique denominations for the coins:

@amereservant
amereservant / auth.php
Created October 22, 2011 23:10
phpFlickr API Detailed Example HowTo
<?php
/* Last updated with phpFlickr 3.1
*
* Edit these variables to reflect the values you need. $default_redirect
* and $permissions are only important if you are linking here instead of
* using phpFlickr::auth() from another page or if you set the remember_uri
* argument to false.
*/
// Include configuration file
@glueckpress
glueckpress / exclude
Last active January 4, 2023 17:57
[git] Exclude .gitignore and all of WordPress, except specified directories
# Sample of .git/info/exclude
# Documentation: https://git-scm.com/docs/gitignore
# Exclude .gitignore file.
# If an initial .gitignore file has been added to the repo,
# you might have to delete it first and sync the change.
# Then create a new one which will be excluded according to this rule.
.gitignore
# Exclude all of WordPress, but keep these directories synced:
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@m1st0
m1st0 / php_build_ubuntu.sh
Last active November 25, 2023 07:33
Compiling PHP 8 on Ubuntu 22.10 with Various Supported Modules
#!/bin/bash
# PHP 8 Compile #
# Author: Maulik Mistry
# Please share support: https://www.paypal.com/paypalme/m1st0
# References:
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
# root-talis https://gist.github.com/root-talis/40c4936bf0287237839ccd3fdfdaec28
#
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active April 16, 2024 21:48
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \