Skip to content

Instantly share code, notes, and snippets.

View bycassius's full-sized avatar
🧃
*sip*

CASSIUS bycassius

🧃
*sip*
  • Melbourne
  • 05:55 (UTC +10:00)
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@billerickson
billerickson / functions.php
Created March 23, 2012 04:00
Homepage Help
<?php
/**
* Add Homepage Help
* @link http://www.billerickson.net/code/homepage-help
*
* @param string $post_type
* @param object $post
*/
function be_homepage_help( $post_type, $post ) {
@GaryJones
GaryJones / functions.php
Created May 25, 2012 10:04 — forked from rogierborst/gist:2786753
Using the template_include filter in WordPress
<?php
add_filter( 'template_include', 'ja_template_include' );
/**
* Apply a template to all subcategories of a certain parent category.
*
* @author Rogier Borst
* @author Gary Jones
* @author Jared Atchison
*
* @link https://gist.github.com/gists/2787095 Current version
@GaryJones
GaryJones / functions.php
Last active December 10, 2015 01:18
WordPress: Add new featured image sizes.
<?php
// Add new featured image sizes
add_image_size( 'home-bottom', 150, 100, true );
add_image_size( 'home-top', 400, 200, true );
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@krisnoble
krisnoble / deploy.php
Last active April 25, 2023 15:52
A slightly modified version of Brandon Summers' script. For more information: http://simianstudios.com/blog/post/using-bitbucket-for-automated-deployment-of-multiple-repositories
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@mollifier
mollifier / zshrc_useful.sh
Last active April 9, 2024 06:29
少し凝った zshrc
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@GaryJones
GaryJones / functions.php
Created March 27, 2013 23:37
Insert ads or other content after specific paragraph in single post content. The second function here would be easily re-usable for inserting additional bits and pieces do whatever content under whatever conditions (e.g. Cinema tickets competition link after 3rd paragraph of Movie CPT).
<?php
add_filter( 'the_content', 'prefix_insert_post_ads' );
/**
* Insert code for ads after second paragraph of single post content.
*
* @param string $content Post content
*
* @return string Amended content
*/
@BronsonQuick
BronsonQuick / gravity_form_elements.xml
Created April 8, 2013 05:04
If you're using your own Gravity Forms CSS styling then import this xml file into your WordPress site to see if you've styled all of the Gravity Form fields and labels correctly.
<?xml version="1.0" encoding="UTF-8"?>
<forms version="1.6.12">
<form labelPlacement="top_label" useCurrentUserAsAuthor="1">
<title><![CDATA[GF Form 1 Test - Top aligned labels, Descriptions below inputs]]></title>
<description><![CDATA[We would love to hear from you! Please fill out this form and we will get in touch with you shortly.]]></description>
<confirmation type="message">
<message><![CDATA[Thanks for contacting us! We will get in touch with you shortly.]]></message>
</confirmation>
<button type="text">
<text><![CDATA[Submit]]></text>