Skip to content

Instantly share code, notes, and snippets.

View sammdec's full-sized avatar

Sam Mason de Caires sammdec

View GitHub Profile
@sammdec
sammdec / Bundle env
Created March 20, 2013 09:04
Bundler issue with installing bcrypt-ruby
Bundler 1.3.1
Ruby 1.9.3 (2013-02-22 patchlevel 392) [x86_64-darwin12.2.1]
Rubygems 2.0.2
GEM_HOME
Bundler settings
path
Set for your local app (/Users/sam/Sites/sample/.bundle/config): "./vendor/bundle"
disable_shared_gems
Set for your local app (/Users/sam/Sites/sample/.bundle/config): "1"
@sammdec
sammdec / post-receive
Created December 21, 2012 15:03
Statamic git push deploy
#!/bin/sh
GIT_WORK_TREE=/path/to/webroot/of/mywebsite git checkout -f
@sammdec
sammdec / custom_excerpt_wp.php
Last active August 15, 2018 12:39
Wordpress Custom Excerpt function
<?php
function get_excerpt($count, $post_id){
$permalink = get_permalink($post_id);
$excerpt = get_post($post_id);
$excerpt = $excerpt->post_content;
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, $count);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
$excerpt = $excerpt;
// Want a read more link and ellipsis, remove the line above this and replace it with the one below.