Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / ImportJSON.gs
Created March 25, 2021 22:48
Google sheets import JSON script
/**
* Imports JSON data to your spreadsheet
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
*/
function ImportJSON(url, xpath) {
try {
// /rates/EUR
var res = UrlFetchApp.fetch(url);
@mtgto
mtgto / repositories
Created January 30, 2018 00:10
[~/.sbt/repositories] Use google's maven central mirror, prevent to redirect for lightbend repository.
# http://www.scala-sbt.org/1.x/docs/Launcher-Configuration.html
# https://storage-download.googleapis.com/maven-central/index.html
[repositories]
local
maven-central: https://maven-central-asia.storage-download.googleapis.com/repos/central/data/
lightbend-ivy-releases: https://dl.bintray.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
#typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots
@remcowesterhoud
remcowesterhoud / behave-parallel.py
Last active January 19, 2022 20:24
All credit goes to s1ider https://gist.github.com/s1ider/f13c2f163282dbec7a61. All I did was fix it up, made it work in Python3 and added Behave Userdata support
"""
Behave runner for running features asynchronously.
"""
from multiprocessing import Pool
from subprocess import call, Popen, PIPE
from glob import glob
import logging
import argparse
import json
from functools import partial
@neutronth
neutronth / letsencrypt-auto-renew
Last active February 19, 2017 12:44
Let's Encrypt auto renew script
#/bin/sh
OPTS=$(getopt -o cehw: --long config:,expire-limit:,help,webservice: -n "$0" -- "$@")
if [ $? != 0 ]; then
echo "Terminating ..." >&2
exit 1
fi
CONFIG=/etc/letsencrypt/cli.ini
WEBSERVICE=nginx
@lukehorvat
lukehorvat / NumberPickerDialogPreference.java
Last active June 17, 2021 14:06
An Android preference class that provides a user with the means to select an integer from a NumberPicker and persist it. (License: MIT License)
package com.lukehorvat;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.NumberPicker;
@hugs
hugs / gist:2493103
Created April 25, 2012 20:31
How to Dynamically Add Android Support to Selenium Server at Runtime
How to Dynamically Add Android Support to Selenium Server at Runtime
----------------------------------------------------------------------------------
1) Launch Selenium Server:
----------------------------------------------------------------------------------
# In a terminal window, run this command:
$ java -jar selenium-server-standalone-2.21.0.jar
Apr 25, 2012 3:53:39 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
15:53:44.584 INFO - Java: Apple Inc. 20.6-b01-415
@NetAngels
NetAngels / runner.py
Created June 24, 2011 04:21
Extremely fast Django test runner
# -*- coding: utf-8 -*-
"""
Extremely fast Django test runner, based on the idea that your database schema
and fixtures are changed much more seldom that your code and tests. All you
need is to make sure that your "quickstart.sqlite" database file is always up
to date.
BEWARE: Don't run this test runner on production server. It assumes that you
use only one database configured as "default", and its db engine is SQLite.
Otherwise your tests can eat your data!
@samuraisam
samuraisam / deep_eq.py
Last active March 29, 2024 22:17
Deep Equality Test for Nested Python Structures
#Copyright (c) 2010-2013 Samuel Sutch [samuel.sutch@gmail.com]
#
#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
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in