Skip to content

Instantly share code, notes, and snippets.

View rveitch's full-sized avatar

Ryan Veitch rveitch

View GitHub Profile
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 1, 2024 14:41
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@cpmpercussion
cpmpercussion / loop_pi_video.sh
Created July 15, 2016 08:31
omxplayer command to loop a video forever for use in video art exhibitions
#!/bin/bash
# This one-liner script plays a video in an infinite loop on a raspberry pi
# for a video-art exhibition.
# It was written for a video in portrait orientation so the video is rotated 270
# to use up the whole screen (which was also rotated).
# Charles Martin, July 2016
omxplayer -o local --loop /home/pi/video.mp4 --orientation 270
@bmcbride
bmcbride / google-form-to-github-issue.md
Last active April 5, 2024 15:47
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@rveitch
rveitch / sass-7-1-pattern.scss
Last active April 23, 2024 08:10
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@mattjohnsonpint
mattjohnsonpint / moment-tz-guess.md
Created September 29, 2015 22:55
Testing moment-timezone guess feature
Windows Display Name Windows ID Preferred Response Moment Guess Result January Offset July Offset Notes
(UTC-12:00) International Date Line West Dateline Standard Time Etc/GMT+12 Etc/GMT+12 Match -12:00 -12:00
(UTC-11:00) Coordinated Universal Time-11 UTC-11 Etc/GMT+11 Pacific/Pago_Pago Acceptable -11:00 -11:00
(UTC-10:00) Hawaii Hawaiian Standard Time Pacific/Honolulu Pacific/Honolulu Match -10:00 -10:00
(UTC-09:00) Alaska Alaskan Standard Time America/Anchorage America/Anchorage Match -09:00 -08:00
@acusti
acusti / install.sh
Last active May 3, 2022 03:39
WordPress install script using WP-CLI: supports Multisite, MAMP, local php.ini overrides, and theme and plugin scaffolding, and will generate optimized .gitignore and .htaccess files.
#!/bin/bash
# Install WordPress
# =================
# Based on many sources, but originally based on:
# @ http://premium.wpmudev.org/blog/set-up-wordpress-like-a-pro/
# See also: http://wprealm.com/blog/wordpress-wp-cli-kung-fu-made-simple/
# BEGIN Configuration
@duogeekdev
duogeekdev / hide-admin-bar-in-wordpress.php
Created February 26, 2015 13:33
Hide admin bar in WordPress
<?php
// Simple way
add_filter( 'show_admin_bar', '__return_false' );
// Standard way
add_filter( 'show_admin_bar', 'show_admin_bar_cb' );
function show_admin_bar_cb() {
return false;
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@pascalduez
pascalduez / SassMeister-input.scss
Last active December 20, 2023 20:38
Some Sass string functions: capitalize, ucwords, camelize, ...
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Capitalize string
// --------------------------------------------------------------------------------
// @param [string] $string
// --------------------------------------------------------------------------------
// @return [string]
@yannisdran
yannisdran / jetpack-localhost-hack
Last active December 11, 2015 20:09
A hack for being able to run Jetpack in WP locally.
# Go to plugins/jetpack/jetpack.php into the folder of your WP local website.
# Find the line (276) below:
/**
* Is Jetpack active?
*/
public static function is_active() {
return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
}