Skip to content

Instantly share code, notes, and snippets.

@denji
denji / README.md
Last active April 26, 2024 18:09 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
@madrobby
madrobby / gist:9476733
Created March 10, 2014 23:34
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path
@ihorvorotnov
ihorvorotnov / wp-get-content
Created February 21, 2014 11:20
WordPress: get post content by ID
/**
* You often need to get the content or title from a specific post.
* Sometimes, using a custom loop is the better option, but when you only need
* to get information from a specific post, there’s a better option
*/
echo get_post_field('post_content', $post_id);
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 2, 2024 18:45
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@markstewie
markstewie / gist:5149902
Created March 13, 2013 07:05
A rewrite of the roots_add_rewrites function for the Roots Wordpress framework so that rewrites work when Wordpress is installed in a subdirectory. This function is found in roots/lib/htaccess.php. Once saved, go to the Settings->Permalinks page and things should work.
function roots_add_rewrites($content) {
global $wp_rewrite;
$base = str_replace('/', '', WP_BASE);
if($base != '') $base = $base.'/';
$roots_new_non_wp_rules = array(
$base .'assets/css/(.*)' => $base . THEME_PATH . '/assets/css/$1',
$base .'assets/js/(.*)' => $base . THEME_PATH . '/assets/js/$1',
$base .'assets/img/(.*)' => $base . THEME_PATH . '/assets/img/$1',
$base .'plugins/(.*)' => $base . RELATIVE_PLUGIN_PATH . '/$1'
);
@jonesch
jonesch / mail-attachment-wordpress
Created October 22, 2012 12:40
Attaching & Validating A File. Wordpress
if(!empty($_FILES['resume']['name'])){ // check to see if we have a photo and a user clicks submit
$accept_file_formats = array(
'image/jpg',
'image/jpeg',
'image/png',
'image/gif',
'text/rtf', //.rtf file
'text/plain', //.txt file
'application/msword', //.doc file
'application/vnd.openxmlformats-officedocument.wordprocessingml.document', //.docx file
@keyboardsurfer
keyboardsurfer / .gitignore
Last active December 11, 2019 01:55
Android gitignore
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# built application files
*.apk
*.ap_
*.jar
!gradle/wrapper/gradle-wrapper.jar
# lint folder
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb: