Skip to content

Instantly share code, notes, and snippets.

@tehsquidge
tehsquidge / upgrade-modx.sh
Created September 3, 2015 15:13
Upgrade MODX
#!/bin/bash
#run in parent directory of public_html
read -e -p "what is the account username? " -i `stat -c "%U" ./` NAME #get the FTP owner account
wget http://modx.com/download/latest -O modx-latest.zip
unzip modx-latest.zip -d modx-latest
cp -R modx-latest/*/* public_html/
cd public_html/setup/
@aaronhuisinga
aaronhuisinga / admin-dir-rename.php
Created September 1, 2015 21:12
WordPress function to change admin URL from /wp-admin/* to /admin/*
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* USAGE:
*
* Copy the file into wp-content/mu-plugins directory and add the
* following RewriteRule to your apache configuration or .htaccess:
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active April 15, 2025 03:39
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@macbleser
macbleser / wp-permissions-script
Created February 21, 2014 15:37
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@chilts
chilts / alexa.js
Created October 30, 2013 09:27
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@mariusGundersen
mariusGundersen / gist:6925246
Last active May 8, 2022 20:38
Programmer collective nouns
@mparker17
mparker17 / Photoshop-to-CSS conversion notes.md
Last active January 12, 2019 18:48
My Photoshop to CSS conversion notes
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active February 8, 2025 07:43
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 16, 2025 19:00
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname