Skip to content

Instantly share code, notes, and snippets.

@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@vrypan
vrypan / dyndns53.py
Last active August 12, 2021 21:43
Python script to add/update an A record at amazon area53 DNS service, using current IP. (ie, dyndns replacement)
from area53 import route53
from boto.route53.exception import DNSServerError
import requests
import sys
from datetime import datetime
# Modified from https://markcaudill.me/blog/2012/07/dynamic-route53-dns-updating-with-python/
domain = 'domain.tld'
subdomain = 'subdomain_name'
@jamesthompson
jamesthompson / GetRedis.scala
Created March 18, 2014 16:17
Get all keys and values from Redis
using: "net.debasishg" %% "redisclient" % "2.11"
// GetRedis.apply will print out all the keys and values in a csv list
object GetRedis {
import com.redis.{RedisClient, RedisClientPool}
def apply = {
val rcp = new RedisClientPool(
sys.env.getOrElse("REDIS_HOST", "localhost"),
6379
)
@kythanh
kythanh / How to delete all Archive binaries generated by XCode
Created August 7, 2014 07:03
How to delete all Archive binaries generated by XCode
1. Open Terminal, then goto this folder: cd ~/Library/Developer/Xcode/Archives
2. Perform delete all folders and files: rm -rf *
You may need root permission to perform delete.
@rponte
rponte / get-latest-tag-on-git.sh
Last active July 4, 2024 10:55
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@abhijeetchopra
abhijeetchopra / 0-README.md
Last active July 15, 2024 07:25
Creating automatic scheduled backup copies of your Google Sheets using Google Apps Script

How to "Schedule Automatic Backups" of your Google Sheets

This tutorial demonstrates how to use Google Apps Script to:

  • Create copies of the Google Sheet in the desired destination folder automatically at set intervals.

  • Append the time stamp with each backup file's name.

  • Adjust time trigger for backing up every day/hour/minute.

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
using UnityEngine.Purchasing.Security;
public class Purchaser : MonoBehaviour, IStoreListener
@kilink
kilink / OkHttpCompletableFuture.kt
Created February 11, 2017 07:26
OkHttp Java 8 CompletableFuture extension method
import okhttp3.Call
import okhttp3.Callback
import okhttp3.Response
import java.io.IOException
import java.util.concurrent.CompletableFuture
fun Call.executeAsync(): CompletableFuture<Response> {
val future = CompletableFuture<Response>()
enqueue(object : Callback {
override fun onResponse(call: Call, response: Response) {
@HighMacGuy
HighMacGuy / first_run.ini
Last active August 18, 2022 16:52 — forked from andyspicer/install.sh
OpenVPN Access Server Letsencrypt
# OpenVPN Let's Encrypt first run config file
#https://loige.co/using-lets-encrypt-and-certbot-to-automate-the-creation-of-certificates-for-openvpn/
cert-name=
authenticator = standalone
standalone-supported-challenges = tls-sni-01
non-interactive = True
rsa-key-size = 4096
email = "user@server.com"
domains = "vpn.server.com"
@jlis
jlis / index.js
Created May 18, 2018 08:49
AWS Lambda function to save events from SQS into DynamoDB
var AWS = require('aws-sdk');
var sqs = new AWS.SQS({
region: process.env.AWS_REGION
});
var dynamodb = new AWS.DynamoDB();
var REPEAT_THRESHOLD = process.env.REPEAT_THRESHOLD || 20000;
function receiveSQSMessages(callback) {
var params = {
QueueUrl: process.env.TASK_QUEUE_URL,