Skip to content

Instantly share code, notes, and snippets.

@code26
code26 / mailchimp-form
Created March 2, 2016 02:59
mailchimp form
<form id="voucherForm" class="form-horizontal subscription-form" action="//joomajam.us3.list-manage.com/subscribe/post-json?u=f64550e28767fd3a1b65f5557&id=fb450161c3&c=?" method="post">
<div class="form-group">
<label for="mce-EMAIL" class="control-label label-email">Enter your Mom’s or Dad’s e-mail</label>
<div class="">
<input type="email" class="form-control" id="mce-EMAIL" name="EMAIL">
</div>
</div>
<div class="row">
<div class="col-sm-8">
<figure class="btn-container full pull-right">
@code26
code26 / wp-get_id_by_slug
Created March 17, 2016 16:16 — forked from eddt/wp-get_id_by_slug
WordPress: Get page ID from slug
// Usage:
// get_id_by_slug('any-page-slug','any-post-type');
function get_id_by_slug($page_slug, $slug_page_type = 'page') {
$find_page = get_page_by_path($page_slug, OBJECT, $slug_page_type);
if ($find_page) {
return $find_page->ID;
} else {
return null;
}
@code26
code26 / README.md
Created April 13, 2016 04:43 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@code26
code26 / backup_restore_tar_centos.txt
Created September 11, 2017 08:20
BACKUP/RESTORE VPS
#BACKUP
tar zcvf - --exclude=/proc --exclude=/sys --exclude=/dev / | ssh myuser@backupmachine_ip_addr "cat > /home/myuser/VPSbackup.tar.gz"
#RESTORE
cd /
ssh myuser@backupmachine_ip_addr "cat /home/myuser/VPSbackup.tar.gz" | tar zxvf -
@code26
code26 / gist:2d1c7b4527b02f2c5c9e398da9eced6f
Created June 19, 2018 15:45
Bash: Search for 'keyword' in files
grep -rnw '/path/to/somewhere/' -e 'pattern'