Skip to content

Instantly share code, notes, and snippets.

View toddpi314's full-sized avatar
💻
Movies, Music & Microcode

Todd Morrison toddpi314

💻
Movies, Music & Microcode
View GitHub Profile
@CJBridges
CJBridges / circleci_command_for_cache_optimization.yml
Last active January 22, 2024 18:56
CircleCI does not support checks for existence of a cache key without restoring the full cache. Save a tiny key in parallel with the cache to allow bailing out faster if the cache already exists. More documentation on the approach and the code I started from (thanks TzookB!) is here: https://tzookb.com/circleci-project-deepdive
commands:
halt_if_cache_exists:
description: Halt a build if a cache already exists, without downloading the entire cache. Match only exact key. Pair with mark_cache_existence.
parameters:
category:
description: friendly name of the sort of cache (e.g. bundle, src)
type: string
key:
description: hash key where underlying data would be stored
@therefromhere
therefromhere / firestore_emulator.py
Last active January 17, 2022 19:45
OBSOLETE, see comment below ||| Connection to the Firestore emulator in python, since it wasn't at that time supported by the official SDK, see https://github.com/googleapis/google-cloud-python/issues/7500
import os
from unittest import mock
import grpc
from google.auth.credentials import Credentials
from google.cloud import firestore
from google.cloud.firestore_v1.gapic import firestore_client
from google.cloud.firestore_v1.gapic.transports import firestore_grpc_transport
@cancerberoSgx
cancerberoSgx / rmnodemodules.sh
Last active January 2, 2024 21:30
remove node_modules and package-lock.json recursively
find . -name "node_modules" -exec rm -rf '{}' +; find . -name "package-lock.json" -exec rm -rf '{}' +;
@joshlk
joshlk / faster_toPandas.py
Last active May 15, 2023 13:48
PySpark faster toPandas using mapPartitions
import pandas as pd
def _map_to_pandas(rdds):
""" Needs to be here due to pickling issues """
return [pd.DataFrame(list(rdds))]
def toPandas(df, n_partitions=None):
"""
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is
repartitioned if `n_partitions` is passed.
@anandsunderraman
anandsunderraman / setChromeOptions.js
Last active May 10, 2024 15:17
Selenium Web Driver Set Chrome Options
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities = webdriver.Capabilities.chrome();
//setting chrome options to start the browser fully maximized
var chromeOptions = {
'args': ['--test-type', '--start-maximized']
};
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
@matijs
matijs / README.md
Last active June 13, 2019 09:03
Instructions and example configuration to install BitTorrent Sync on a Raspberry Pi running Arch Linux.

Installing BitTorrent Sync on a Raspberry Pi running Arch Linux

The commands below assume you're using a user that can use sudo, you're not logged in as root are you!?

First create a btsync user:

sudo useradd -M --shell /bin/false --home /var/lib/btsync
@scarolan
scarolan / Powershell_Install_Cygwin_Packages
Created July 7, 2013 22:09
Powershell code for installing cygwin packages.
# Download and install cygwin and some packages
function Install-Cygwin {
param ( $TempCygDir="$env:temp\cygInstall" )
if(!(Test-Path -Path $TempCygDir -PathType Container))
{
$null = New-Item -Type Directory -Path $TempCygDir -Force
}
$client = new-object System.Net.WebClient
$client.DownloadFile("http://cygwin.com/setup.exe", "$TempCygDir\setup.exe" )
# This does a vanilla installation of Cygwin
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global: