Skip to content

Instantly share code, notes, and snippets.

View HoldYourWaffle's full-sized avatar
💭
I may be slow to respond.

Ravi van Rooijen HoldYourWaffle

💭
I may be slow to respond.
View GitHub Profile
@jlhernando
jlhernando / decode URL Apps Script
Created April 6, 2022 10:21
Decode URLs in Google Sheets creating a custom fucntion in Apps Script
/* Both these funcitons will work fine */
// As a function declaration
function DECODE(url) {
return decodeURI(url)
}
// Or as an arrow function
const DECODEURL = (url) => decodeURI(url)
/*
MIT License
Copyright (c) 2020 Camden B
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@marcghorayeb
marcghorayeb / gulpfile.js
Created June 25, 2018 12:57
Gulp + TSC hack
let isWatching = false;
gulp.task('ts', () => {
return new Promise((resolve, reject) => {
const cmd = 'npx';
const args = ['tsc'];
if (isWatching) {
args.push('-w', '--preserveWatchOutput');
}
@williewillus
williewillus / primer.md
Last active April 22, 2024 15:29
1.13/1.14 update primer

This primer is licensed under CC0, do whatever you want.

BUT do note that this can be updated, so leave a link here so readers can see the updated information themselves.

1.13 and 1.14 are lumped together in this doc, you're on your own if you just want to go to 1.13 and not 1.14, for some reason.

1.15 stuff: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

Things in Advance

  • ResourceLocation now throw on non-snake-case names instead of silently lowercasing for you, so you probably should go and change all those string constants now. More precisely, domains must only contain alphanumeric lowercase, underscore (_), dash (-), or dot (.). Paths have the same restrictions, but can also contain forward slashes (/).
@jrosell
jrosell / TwitterPowerQuery.pbi
Created December 11, 2017 13:27
This Power Query script gets an bearer token and performs a tweet search from the Twitter REST API
/*
Author: https://chris.koester.io/index.php/2015/07/16/get-data-from-twitter-api-with-power-query/
Twitter REST API
https://dev.twitter.com/oauth/application-only
Requires establishing a Twitter application in order to obtain a Consumer Key & Consumer Secret
https://apps.twitter.com/
IMPORTANT - The Consumer Key and Consumer secret should be treated as passwords and not distributed
*/
let
@lordcodes
lordcodes / current-git-branch.gradle
Last active January 11, 2024 03:54
Gradle function to get the current Git branch
def getCurrentGitBranch() {
def gitBranch = "Unknown branch"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
result.waitFor()
if (result.exitValue() == 0) {
gitBranch = result.text.trim()
}
} catch (e) {
@marcelbirkner
marcelbirkner / reading-property-from-file.sh
Created March 7, 2016 13:19
Read property from properties file within Shell Script
#!/bin/sh
PROPERTY_FILE=apps.properties
function getProperty {
PROP_KEY=$1
PROP_VALUE=`cat $PROPERTY_FILE | grep "$PROP_KEY" | cut -d'=' -f2`
echo $PROP_VALUE
}