Skip to content

Instantly share code, notes, and snippets.

View chr1s1's full-sized avatar

Christoph Weil chr1s1

View GitHub Profile
@enogylop
enogylop / deepl_for_google_sheets.txt
Last active January 30, 2024 07:06
Deepl script for google sheets
function deepl(value1, value2, value3) {
var url = `https://api-free.deepl.com/v2/translate?auth_key=xxxx-xxxx-xxxx-xxxx-xxxx&text=${value1}&target_lang=${value3}&source_lang=${value2}`;
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var data = JSON.parse(json);
return data.translations && data.translations.length > 0 ? data.translations[0].text : "No value";
// replace auth_key with a "Deepl for developer" API key
// source : this script is a modified version of
// http://5.9.10.113/67485395/google-sheets-custom-function-to-translate-with-deepl-api-not-working-as-expecte
}
@fizerkhan
fizerkhan / Email-verifier.js
Created October 20, 2017 09:55 — forked from augfrank/Email-verifier.js
Google Sheet script to verify email addresses automatically
/**
* A custom function that verifies an email ID
*
* @param {String} email ID
* @return {Boolean} If the email ID is active
* @customfunction
*/
function verifyEmail(email) {
// Replace this with your Hunter.io API key
@samba
samba / shopify.datalayer.html
Last active August 2, 2024 13:17
Shopify DataLayer Checkout
{% if first_time_accessed %}
<script>
(function(dataLayer){
var customer_type = ({{customer.orders_count}} > 1) ? 'repeatcustomer' : 'newcustomer';
var discounts = "{{ order.discounts | map: 'code' | join: ',' | upcase}}";
function strip(text){
return text.replace(/\s+/, ' ').replace(/^\s+/, '').replace(/\s+$/, '');
}
@lukemelia
lukemelia / report_open_experiments_to_yappie_job.rb
Created April 22, 2014 17:11
Reporting active A/B tests to Slack using Split, Sidekiq, Sidetiq
class ReportOpenExperimentsToYappieJob
include Sidekiq::Worker
sidekiq_options :queue => :yappie
include Sidetiq::Schedulable
recurrence { daily.hour_of_day(9) }
def perform
active_experiments = Split::Experiment.all.select{ |exp| exp.winner.nil? }
active_experiments.each do |experiment|
@jdevalk
jdevalk / gist:5623050
Created May 21, 2013 20:39
Redirect script sample NGINX code. Make sure this location line sits above the "location /" code in your NGINX config.
location /redirect/ {
rewrite ^/redirect/(.*)$ /redirect/index.php?id=$1 last;
}