Skip to content

Instantly share code, notes, and snippets.

View nothingatalldotnet's full-sized avatar
💭
it's coming it's real

RJ nothingatalldotnet

💭
it's coming it's real
View GitHub Profile
@jchristopher
jchristopher / functions.php
Created February 20, 2018 14:30
Programmatically override the Custom Fields for a SearchWP engine
<?php
class SwpProgrammaticCustomFields {
// These meta keys will be indexed and made searchable
private $meta_keys = array(
array(
'post_type' => 'post',
'meta_keys' => array(
array(
@federivo
federivo / gist:a1c56909b3f712e516a3cd2f70c0eaa6
Last active December 29, 2021 07:33
Install unison in centos
#https://github.com/dcosson/vagrant-unison2
yum install ocaml ocaml-camlp4-devel ctags ctags-etags
cd ~
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz
tar xvfz unison-2.48.4.tar.gz
cd src
make
@pedro-santiago
pedro-santiago / migrate.sh
Last active November 18, 2020 22:20 — forked from gghughunishvili/migrate1.sh
Upgrade MAMP 4 to Mysql 5.7.18 (on Sierra tested)
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz
echo "Stopping MAMP"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "Copy Bin"
@ArturT
ArturT / Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
Last active June 20, 2018 11:46
Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz
$ tar -xvzf openssl-1.0.2h.tar.gz
$ cd openssl-1.0.2h
$ ./config --prefix=/usr/
$ make depend
@ikennaokpala
ikennaokpala / cloudflare.conf
Created January 11, 2016 07:38 — forked from CodySwannGT/cloudflare.conf
WordPress/Nginx/PHP/Varnish Configuration
# /etc/nginx/cloudflare.conf
# If using Cloudflare, uncomment the following to get proper originating IPs
#set_real_ip_from 204.93.240.0/24;
#set_real_ip_from 204.93.177.0/24;
#set_real_ip_from 199.27.128.0/21;
#set_real_ip_from 173.245.48.0/20;
#set_real_ip_from 103.22.200.0/22;
#set_real_ip_from 141.101.64.0/18;
#real_ip_header CF-Connecting-IP;
@MatthewCallis
MatthewCallis / defer.coffee
Created September 18, 2015 17:58
Defer Loading of Scripts
downloadJSAtOnload = ->
scripts = [
{ src: '//www.googleadservices.com/pagead/conversion.js' } # Google Adwords
{ src: '//platform.twitter.com/oct.js' } # Twitter Conversion Tracking
{ src: "//js.hubspot.com/analytics/#{(Math.ceil(new Date()/300000)*300000)}/123456.js", id: 'hs-analytics' } # Hubspot
{ src: '//tag.perfectaudience.com/serve/SHASHASHASHASHASHA.js' } # Perfect Audience
{ src: '//cdn.bizible.com/_biz-a.js', id: 'bizible-settings' } # Bizible
{ src: "#{if ("https:" is document.location.protocol) then "https://s" else "http://a"}.adroll.com/j/roundtrip.js" } # Adroll
]
for script in scripts
@abernardobr
abernardobr / Install Graphics Magick on CentOS 7
Last active December 21, 2021 22:43
Install Graphics Magick on CentOS 7
# Get Graphics Magick
> cd /
> mkdir /dowload
> cd /download
> wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-LATEST.tar.gz
> tar -xzvf GraphicsMagick-LATEST.tar.gz
> cd GraphicsMagick-1.3.21 (or the lastest graphics magick)
# Install Graphics Magick
## Get libs
@v0lkan
v0lkan / nginx.conf
Last active July 12, 2024 08:28
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@chrismdp
chrismdp / s3.sh
Last active July 23, 2024 16:47
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@jnlsn
jnlsn / functions.php
Last active February 20, 2022 20:28
WP Query Orderby Taxonomy Term Name
add_filter('posts_clauses', 'posts_clauses_with_tax', 10, 2);
function posts_clauses_with_tax( $clauses, $wp_query ) {
global $wpdb;
//array of sortable taxonomies
$taxonomies = array('example-taxonomy', 'other-taxonomy');
if (isset($wp_query-&gt;query['orderby']) &amp;&amp; in_array($wp_query-&gt;query['orderby'], $taxonomies)) {
$clauses['join'] .= "
LEFT OUTER JOIN {$wpdb-&gt;term_relationships} AS rel2 ON {$wpdb-&gt;posts}.ID = rel2.object_id
LEFT OUTER JOIN {$wpdb-&gt;term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id
LEFT OUTER JOIN {$wpdb-&gt;terms} USING (term_id)