Skip to content

Instantly share code, notes, and snippets.

@giovannicocco
giovannicocco / Cookies.tsx
Last active September 20, 2023 10:14
Get Cookies Values and Display It in Framer.com
// Create a TSX file of type override by clicking on Assets -> Code and clicking on (+);
//Copy, paste the code below and save;
//Go to Pages, select the page and select the paragraph or heading you want to display the cookie value;
//In the right side menu go to Code Overrides and click (+), select the Cookies file;
//In Overrides select withCookies;
//Publish your page and you're done.
// In this example I am getting the value from _fbp cookie
import type { ComponentType } from "react"
import Cookies from "cookiejs"
@slaporte
slaporte / Code.gs
Created November 15, 2020 00:46
Google Apps Script to send an email (from a Doc template) based on a response to a form. Used for Wiki Loves Monuments email confirmation.
/**
* Based on: https://github.com/googleworkspace/solutions/blob/master/content-signup/src/Code.js
*/
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/***/edit?usp=sharing';
var EMAIL_SUBJECT = '[Response requested] Please confirm your Wiki Loves Monuments winners';
var CC_RECIPIENTS = 'lodewijk@effeietsanders.org, erinamukuta@gmail.com'
/**
* Installs a trigger on the Spreadsheet for when a Form response is submitted.
@abyx
abyx / angular-error-handling.js
Last active February 4, 2022 19:19
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
@plentz
plentz / nginx.conf
Last active July 25, 2024 09:38
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048