Skip to content

Instantly share code, notes, and snippets.

@vcaraulean
vcaraulean / Spreadsheet-to-Trello
Last active June 26, 2017 15:11
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…
/**
* 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");
anonymous
anonymous / googleappsscript.txt
Created October 13, 2017 17:34
Auto respond to share requests
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>";
@IzumiSy
IzumiSy / manifest.json
Last active November 6, 2022 20:29
Chrome.storage.sync example
{
"name": "SyncExtension",
"version": "0.1",
"manifest_version": 2,
"description": "Storage Sync Extension",
"permissions": [ "storage" ],
"browser_action": {
@wiledal
wiledal / template-literals-3-for-loops.js
Last active March 13, 2023 22:47
Template Literals example: For loops
/*
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) => `

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
@Downes
Downes / vhost.sh
Last active January 19, 2024 09:17 — forked from mattmezza/vhost.sh
bash script to create virtual host vhost with apache2 and Ubuntu
#!/bin/bash
# This script was originally used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Adapted for Apache2 on Ubuntu by Stephen Downes at https://www.downes.ca
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files
@butlerblog
butlerblog / wp_config.php
Last active February 1, 2024 09:00
Configure WordPress #wp_mail function to send through #SMTP server https://b.utler.co/Y3
<?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 March 30, 2024 12:28
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

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].

@tanaikech
tanaikech / submit.md
Last active April 2, 2024 15:55
Redeploying Web Apps without Changing URL of Web Apps for new IDE

Redeploying Web Apps without Changing URL of Web Apps for new IDE

At March 15, 2021, one endpoint is created for one deployment. Ref By this, when you redeploy "Web Apps", the endpoint is changed. Because the deployment ID is changed. It seems that this it the new specification. In this report, I would like to introduce the method for redeploying Web Apps without changing the URL of Web Apps for new IDE.

Deploy Web Apps

  1. Open "New deployment" dialog with "Deploy" -> "New deployment".

  2. Select "Web app" for "Select type".

@mesgarpour
mesgarpour / appsScript_ListFilesFolders_ver.2.js
Last active April 22, 2024 01:35
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* 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