Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian bennettscience

View GitHub Profile
View gif-from-tweet.md

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
anonymous
anonymous / googleappsscript.txt
Created Oct 13, 2017
Auto respond to share requests
View googleappsscript.txt
function checkEmail() {
// get all emails that are currently starred
var starredThreads = GmailApp.getStarredThreads();
// edit the auto response below
var email = "dwees@newvisions.org";
var name = "David Wees";
var salutation = "Regards, David Wees, Formative Assessment Specialist for New Visions for Public Schools";
var htmlSalutation = "<p>Regards,</p><p>David Wees<br /> Formative Assessment Specialist for New Visions for Public Schools,</p>";
@wiledal
wiledal / template-literals-3-for-loops.js
Last active Sep 25, 2020
Template Literals example: For loops
View template-literals-3-for-loops.js
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `
@mesgarpour
mesgarpour / appsScript_ListFilesFolders_ver.2.js
Last active Oct 23, 2020
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
View appsScript_ListFilesFolders_ver.2.js
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@butlerblog
butlerblog / wp_config.php
Last active Oct 28, 2020
Configure WordPress wp_mail function to send through SMTP server https://b.utler.co/Y3
View wp_config.php
<?php
/*
* Set the following constants in wp-config.php.
* These should be added somewhere BEFORE the constant ABSPATH is defined.
*
* Author: Chad Butler
* Author URI: https://butlerblog.com
*
* For more information and instructions, see: https://b.utler.co/Y3
@Zearin
Zearin / python_decorator_guide.md
Last active Oct 26, 2020
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)
View python_decorator_guide.md

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@IzumiSy
IzumiSy / manifest.json
Last active Jun 2, 2020
Chrome.storage.sync example
View manifest.json
{
"name": "SyncExtension",
"version": "0.1",
"manifest_version": 2,
"description": "Storage Sync Extension",
"permissions": [ "storage" ],
"browser_action": {
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Sep 27, 2020
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@vcaraulean
vcaraulean / Spreadsheet-to-Trello
Last active Jun 26, 2017
This is a Google Apps Script Engine that imports data from Google Spreadsheet to Trello. This script was used to import SoftShake'13 conference submissions from the spreadsheets to Trello. So, it's highly specific for SoftShake and it's one-off thing. Still, may be used as a base for more complex things. The conference had 2 spreadsheets, for Fr…
View Spreadsheet-to-Trello
/**
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function uploadTracksToTrello() {
// Security settings
// Requesting token: https://trello.com/1/authorize?key=your app key&name=softshake+upload&expiration=never&response_type=token&scope=read,write
ScriptProperties.setProperty("appKey", "your app key");
ScriptProperties.setProperty("token", "your token");
You can’t perform that action at this time.