Skip to content

Instantly share code, notes, and snippets.

View sl18eu's full-sized avatar
💻
beep, beep, beep...

sl18eu

💻
beep, beep, beep...
View GitHub Profile
// @OnlyCurrentDoc
const BearerTokenKey = 'twitterBearerToken';
function onOpen() {
SpreadsheetApp
.getUi()
.createMenu('Twitter')
.addItem('Set Bearer token', 'helpers.requestBearerToken')
.addItem('Sign out', 'helpers.logout')
@iamdaniele
iamdaniele / Tweet functions.gs
Last active February 12, 2023 05:40
Add public metrics
const BearerTokenKey = 'twitterBearerToken';
function onOpen() {
SpreadsheetApp
.getUi()
.createMenu('Twitter')
.addItem('Set Bearer token', 'helpers.requestBearerToken')
.addItem('Sign out', 'helpers.logout')
.addToUi();
}
@bene-we
bene-we / README.md
Last active May 3, 2024 13:23
Calculate the age of a person and write it to the event's description in your birthday calendar using Google Apps Script

Calculate the age of a person and write it to the event's description in your birthday calendar using Google Apps Script

This script uses Google Apps Script to access one's Google Calendar and calculate the age on a person's birthday. In the best case you have a custom calendar where your birthdays are stored at. If not, uncomment line 20 and use the filter function at the bottom.

Steps to setup everything

  1. Head to https://script.google.com/home/my and create a new project. Rename the existing file Code.gs to your liking and paste the code from calculateAge.gs.
  2. Paste your calendar ID in line 9 (you can find it in the Google Calendar Settings)
  3. Make sure to add the birth year of a person to the location field (or customize the script)
  4. Customize the message in line 36
@dividezigns
dividezigns / single-template_name.php
Last active February 15, 2023 16:53
This code will use ACF's galley field with Divi's native gallery module. Place this code snippet in your single template file located in your child theme directory.
<?php
$columnNumber++
?>
<div class="et_pb_row et_pb_row_<?php echo $columnNumber++ ?> et_pb_gutters2 wcf_gallery_row">
<div class="et_pb_column et_pb_column_4_4 et_pb_column_<?php echo $columnNumber++ ?>">
<div class="et_pb_module et_pb_gallery et_pb_gallery_<?php echo $columnNumber++ ?> et_pb_gallery_grid et_pb_bg_layout_light clearfix">
<div class="et_pb_gallery_items et_post_gallery clearfix" data-per_page="20">
<?php
@Ryonez
Ryonez / (Unofficial) Discord server rules suggestions list.md
Last active May 11, 2024 03:28
(Unofficial) Discord server rules suggestions list

Discord

(Unofficial) Discord server rules suggestions list

Author's Note

I'll start off with letting you know this is a fork from someone else. However, for some bizarre reason, this is the one everyone finds, so I better get round to updating this. Credit to Cristiano#2233 for the original idea.

Also, I've had a lot of people saying the rules are to strict. If you pick all the rules here, you're right, it would be very strict. However the rules below are guidelines! They are there for you to pick the ones you desire, you can ignore ones you don't want. Hopefully they might help with rules you wouldn't have thought of otherwise.

@igorbenic
igorbenic / desc.php
Last active February 21, 2024 21:32
How to Programmatically Change Yoast SEO Open Graph Meta | http://www.ibenic.com/programmatically-change-yoast-seo-open-graph-meta
<?php
function change_yoast_seo_og_meta() {
add_filter( 'wpseo_opengraph_desc', 'change_desc' );
}
function change_desc( $desc ) {
// This article is actually a landing page for an eBook
if( is_singular( 123 ) ) {
@lukecav
lukecav / functions.php
Last active November 15, 2023 18:36 — forked from eteubert/wordpress-passwort-reset-unmultisite.php
WordPress Multisite: Password Reset on a Subsite.
/**
* Password reset on sub site (1 of 4)
* Replace login page "Lost Password?" urls.
*
* @param string $lostpassword_url The URL for retrieving a lost password.
* @param string $redirect The path to redirect to.
*
* @return string
*
* @since 1.0.0
@friartuck6000
friartuck6000 / acf-field-group-schema.json
Created April 12, 2016 18:34
JSON schema for Advanced Custom Fields (ACF) field groups
{
"$schema": "http://json-schema.org/schema#",
"id": "http://advancedcustomfields.com/json-schema/field_group",
"type": "object",
"definitions": {
"empty": {
"type": "string",
"maxLength": 0
},
"intOrEmpty": {
@kylephillips
kylephillips / favorites-user-list-filter.php
Created August 15, 2015 03:31
Example of using the User List filter in the Favorites WordPress plugin
add_filter('simplefavorites_user_list', 'filter_favorites_user_list', 10, 3);
function filter_favorites_user_list($output, $users, $anonymous_count)
{
$output = '<ul>';
foreach($users as $user){
$output .= '<li><a href="' . site_url() . '/members/' . $user->user_login . '">' . $user->display_name . '</a></li>';
}
$output .= '</ul>';
$output .= '(+' . $anonymous_count . ' Anonymous Users)';
return $output;
@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active May 4, 2024 18:30
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/