title | author |
---|---|
Huntress |
H. D. |
Come, blunt your spear with us,
our pace is hot
and our bare heels
in the heel-prints—
we stand tense—do you see—
# Create a new empty repository in GitHub (without readme or licesne. empty!) | |
# then copy down your bitbucket repo. --mirror helps you get everything. | |
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git | |
cd repository-to-mirror/ | |
# update the URL used as the remote | |
git remote set-url origin git@github.com:User/UserRepo.git |
<?php | |
function my_find_expired_events( $ids ) { | |
$args = array( | |
'post_type' => 'tribe_events', | |
'nopaging' => true, | |
'fields' => 'ids', | |
'meta_query' => array( | |
array( |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
// MARGIN CALCULATOR | |
// source: https://goo.gl/D3k5Fz | |
/* here's some javascript, courtesy John Smith, to calculate the margins */ | |
var width = 5.5; | |
var height = 8.5; | |
// and here are all the paper sizes you could ever need | |
// as inputs to the script above to calculate the margins: |
title | author |
---|---|
Huntress |
H. D. |
Come, blunt your spear with us,
our pace is hot
and our bare heels
in the heel-prints—
we stand tense—do you see—
SELECT | |
-- Assumed to be trimmed | |
name | |
-- Does name contain multiple words? | |
,(LOCATE(' ', name) = 0) AS hasMultipleWords | |
-- Returns the end of the string back until reaches a space. | |
-- E.g. "John Doe" => "Doe" | |
-- E.g. "Francis Scott Key" => "Key" |
function Add-Path() { | |
[Cmdletbinding()] | |
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder) | |
# Get the current search path from the environment keys in the registry. | |
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path | |
# See if a new folder has been supplied. | |
if (!$AddedFolder) { | |
Return 'No Folder Supplied. $ENV:PATH Unchanged' | |
} | |
# See if the new folder exists on the file system. |
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g} | |
require File.join(File.dirname(__FILE__), "downmark_it") | |
module WordPress | |
def self.import(database, user, password, table_prefix = "wp", host = 'localhost') | |
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8') | |
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder} |
#!/bin/bash | |
# | |
# Crawls a domain | |
# Retreives all visible URLs and their page titles | |
# Saves to CSV | |
# $1 = URL | |
# $2 = csv filename | |
# | |
# USAGE: | |
# save this script as, say, crawler.sh”. |
<snippet> | |
<content><![CDATA[ | |
--- | |
title: ${1:title} | |
date: | |
tags: ${2:#@work} | |
--- | |
]]></content> | |
<tabTrigger>note</tabTrigger> | |
<description>Create a simple YAML header</description> |