Skip to content

Instantly share code, notes, and snippets.

View rveitch's full-sized avatar

Ryan Veitch rveitch

View GitHub Profile
@rveitch
rveitch / cos-common-mime-types-map.js
Last active February 1, 2025 00:05
Mime Types Map
[
{
name: '3GP',
mime_type: 'video/3gpp',
extension: '3gp'
},
{
name: 'Adobe Photoshop',
mime_type: 'application/x-photoshop',
extension: 'psd'
@rveitch
rveitch / index.js
Created November 28, 2018 15:52
fb-instagram-webhooks-node-example
// heroku callback url = https://fb-instagram-webhooks.herokuapp.com/facebook
// local callback url = http://rveitch.local.coschedule.ngrok.io/facebook
const dotenv = require('dotenv').load();
const bodyParser = require('body-parser');
const express = require('express');
const app = express();
const xhub = require('express-x-hub');
const _ = require('lodash');
const fbUtilities = require('./utilities/fb-utilities');
@rveitch
rveitch / FCC Search API Examples.postman_collection.json
Created October 13, 2018 19:05
FCC Search API Postman Examples
{
"info": {
"_postman_id": "ceb9fe22-edf1-fc39-c09f-6af320d9e398",
"name": "FCC Search API Examples",
"description": "Search examples for the HackFargo Civic Hackathon - 2016",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Search Examples -01- URI Search API",
@rveitch
rveitch / dropbox-data-example.md
Created September 28, 2018 21:55
Dropbox Data Example

Dropbox Example:

/dropbox-example image

/dropbox-example/misc files image

curl -X POST https://api.dropboxapi.com/2/files/list_folder \
@rveitch
rveitch / twitter_image_post_response.json
Last active February 1, 2025 00:40
Twitter Post Example Responses
{
"created_at": "Tue May 22 19:58:13 +0000 2018",
"id": 999016602942214100,
"id_str": "999016602942214144",
"full_text": "Four Images (Native Post) https://t.co/CQSsUj4vgC",
"truncated": false,
"display_text_range": [
0,
25
],
@rveitch
rveitch / facebook_link_post_response.json
Created May 22, 2018 20:11
Facebook Response Object for a Link Post (Example)
{
"id": "100006989444393_2104617929781168",
"message": "Scrapey McTest 2",
"created_time": "2018-05-22T18:34:01+0000",
"attachments": {
"data": [
{
"description": "Cable can totally defeat Thanos ... at good storytelling.",
"media": {
"image": {
@rveitch
rveitch / coschedule-get_full_post.php
Last active February 1, 2025 00:42
CoSchedule WordPress Plugin - Get Full Post Example (Debug Bar Console)
<?php
// Debug the CoSchedule Plugin
$post_id = 522; // Replace this ID with an ID of a post you want to check.
if (class_exists( 'TM_CoSchedule' )) {
$coschedule = new TM_CoSchedule;
$full_post = $coschedule->get_full_post( $post_id );
echo '$full_post:<br><pre>'; print_r(json_encode($full_post, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)); echo '</pre><br><br>';
} else {
echo 'Class does not exist.';
}
@rveitch
rveitch / getCurrentBestBodyParts.js
Created January 4, 2018 20:05
getCurrentBestBodyParts.js
getCurrentBestBodyParts(Game) {
const roomEnergy = energyController.getRoomEnergyInfo(Game);
const energyAvailable = roomEnergy.sourceEnergy.sourceEnergy;
if (energyAvailable <= 300) {
return [WORK,WORK,CARRY,MOVE];
}
if (energyAvailable <= 400) {
return [WORK,WORK,WORK,CARRY,MOVE];
@rveitch
rveitch / screeps_javascript_basics.md
Last active February 1, 2025 00:42
Screeps Javascript Basics

Types of Things

String

Basically text.

var screepName = 'screepalicious';

Array: [ ]

Basically a list or group of things, which can be of varying types.

@rveitch
rveitch / groups.yml
Created December 5, 2017 03:24
hass_xbl.yml
xbox_live:
name: Xbox Live
icon: mdi:xbox
view: Yes
entities:
- group.xbl_friends
xbl_friends:
name: Xbox Live Friends
view: no
entities: