Skip to content

Instantly share code, notes, and snippets.

@roboncode
roboncode / firestore.go
Last active April 26, 2024 09:51
Firestore - GoLang Transform Struct To Map
package transform
import (
"reflect"
"strings"
"time"
)
const (
tagName = "firestore"
import os
import sys
import shutil
import multiprocessing as mp
from itertools import repeat as re
import dateparser
import pytz
import json
import csv
import datetime
@guysoft
guysoft / reminders.py
Created December 31, 2018 10:05
Get google calendar reminder api
#!/usr/bin/env python3
## How to use
##
## 1. enter http://calendar.google.com/
## 2. press ctrl+alt+J in chrome to ender the developer tools and select the "network" tab. In firefox ctrl+shift+elif
## 3. refresh and make sure "reminders" is checked.
## 4. search for "reminder" in url filters and look for a url of the form: https://reminders-pa.clients6.google.com/v1internalOP/reminders/list?key=
## 5. Copy the key and the followind headers and cookies below:
## For mor info see: https://issuetracker.google.com/issues/36760283
@denisbrodbeck
denisbrodbeck / main.go
Last active February 2, 2023 22:35
How to generate secure random strings in golang with crypto/rand.
// License: MIT
package main
import (
"crypto/rand"
"fmt"
"math/big"
)
// GenerateRandomASCIIString returns a securely generated random ASCII string.
@ralavay
ralavay / vim-nginx-conf-highlight.sh
Last active April 21, 2024 03:58
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
cat > ~/.vim/filetype.vim <<EOF
@vshank77
vshank77 / GsonSerializerTest.java
Created May 13, 2015 14:44
Serialize ImmutableList with GSON
public class JsonSerializerTest {
@Test
public void testGsonInterpret() throws Exception {
Definition expected = Definition.builder().domain("places").traitName("TrainStation")
.desc("london underground").tag("lgu").tag("tube").tag("tfl")
.property(Property.builder("name", StringTraitRef))
.property(Property.builder("age", IntegerTraitRef))
.build();
Gson gson = new GsonBuilder()
@markormesher
markormesher / GetSmallCapsString.java
Last active November 21, 2023 19:13
Create a small-caps spannable string that will work with any font
/**
* Produce a formatted SpannableString object from a given String
* input, with all lowercase characters converted to smallcap
* characters. Uses only standard A-Z characters, so works with
* any font.
*
* @param input The input string, e.g. "Small Caps"
* @return A formatted SpannableString, e.g. "Sᴍᴀʟʟ Cᴀᴘs"
*/
public static SpannableString getSmallCapsString(String input) {
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"