Skip to content

Instantly share code, notes, and snippets.

@emersonthis
emersonthis / 01_Initial command
Created May 8, 2024 18:41 — forked from noelrappin/01_Initial command
Gist for Let's Build A Gem With Rails
bundle gem change_ledger --coc --mit --exe --test=rspec --ci=github --linter=standard
const likert1 = {
id: 1,
identifier: 'abc123',
type: 'Likert',
verified_at: '2023-10-01',
title: null,
question: 'Do you like these companies?',
columns: [
{ id: 1, label: 'Yes', color: '#ff0000' },
{ id: 2, label: 'No', color: '#0ff000' },
@emersonthis
emersonthis / gist:08126d6c425b8b3c5fed94a8aaa2c217
Last active October 14, 2016 16:18 — forked from swalkinshaw/gist:2695510
WordPress: Mandatory Excerpt
<?php
function mandatory_excerpt($data) {
$excerpt = $data['post_excerpt'];
if (empty($excerpt)) {
if ($data['post_status'] === 'publish') {
add_filter('redirect_post_location', 'excerpt_error_message_redirect', 99);
}
$data['post_status'] = 'draft';
}
return $data;
@emersonthis
emersonthis / wordpress-plugin-svn-to-git.md
Created November 1, 2015 23:55 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@emersonthis
emersonthis / gist:429af674f0a4e3692dcc
Last active September 16, 2015 18:07 — forked from leemark/gist:11237860
prefixed CSS for slideshow example
/* http://themarklee.com/2013/10/16/simple-crossfading-slideshow-css/ */
.css-slideshow {
position: relative;
max-width: 495px;
height: 370px;
margin: 1em auto .5em auto;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
.css-slideshow figure {
@emersonthis
emersonthis / sheets-api-test-part2.php
Last active September 15, 2015 22:23 — forked from karlkranich/sheets-api-test-part2.php
PHP code to use the Google Spreadsheets API with an OAuth Service Account. For more info, see http://karl.kranich.org/google-sheets-api-php
<?php
// Section 5: edit a row
// You'll need to get the etag and row ID, and send a PUT request to the edit URL
$rowid = 'cre1l'; // got this and the etag from the table data output from section 3
$etag = 'NQ8VCRBLVCt7ImA.';
$url = "https://spreadsheets.google.com/feeds/list/$fileId/od6/private/full/$rowid";
$method = 'PUT';
$headers = ["Authorization" => "Bearer $accessToken", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0'];
$postBody = "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\" xmlns:gd=\"http://schemas.google.com/g/2005\" gd:etag='&quot;$etag&quot;'><id>https://spreadsheets.google.com/feeds/list/$fileid/od6/$rowid</id><gsx:gear>phones</gsx:gear><gsx:quantity>6</gsx:quantity></entry>";
$req = new Google_Http_Request($url, $method, $headers, $postBody);