WordPress Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get purge php5-common -y | |
#sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y | |
sudo apt-get install -y \ | |
php \ | |
libapache2-mod-php \ | |
php-fpm \ | |
php-mysql \ | |
php-memcached \ | |
php-pear \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will allow to use a .gif extension. | |
# Script can now be used as www.mydomain.com/pokemon.gif | |
RewriteEngine on | |
RewriteRule ^(.*).gif giphy.php?tag=$1 [L,QSA] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir wordpress-site && cd wordpress-site | |
touch docker-compose.yml | |
cat > docker-compose.yml <<EOL | |
my-wpdb: | |
image: mariadb | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// on page load, search for & display a random gif matching your search term using the Giphy API. | |
// usage: | |
// include giphy.js in your <head> | |
// set q to your search term (e.g. "brunch") | |
// add <span id = "giphyme"></span> wherever you want to display the image. -- FYI, it will be centered. | |
// big ups to the Giphy crew (giphy.com) | |
// 2014 - Neal Shyam [@nealrs | nealshyam.com] | |
document.addEventListener('DOMContentLoaded', function () { | |
q = "finger guns"; // search query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Chain's Webhooks system will send an HTTP request | |
to our app with an event type of 'address-transaction'. | |
The body of the request will contain Chain's transaction | |
object. We can use this payload to do whatever we want! | |
*/ | |
app.post('/', function (req, res) { | |
if (req.body['event'] == 'address-transaction') { | |
sendSMS(req.body.transaction) | |
res.send('OK\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
# TURN Server Setup | |
# Requires SSL setup - see https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b | |
##### | |
sudo apt-get update | |
sudo apt-get install resiprocate-turn-server | |
nano /etc/reTurn/reTurnServer.config | |
# Change TurnAddress to your public IP address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
# Signalling Server Setup ex: EasyRTC | |
# See https://easyrtc.com/docs/guides/easyrtc_server_install.php | |
# This assumes you followed https://gist.github.com/sbeleidy/f4cd7e96dc0910dbc27cc6845d8b4d22 and | |
# https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b for SSL and reTURN setup | |
##### | |
# Install node | |
sudo apt-get install nodejs | |
sudo apt-get install npm |
NewerOlder