Skip to content

Instantly share code, notes, and snippets.

@mr-salty
mr-salty / clean-bazel-cache.sh
Last active January 21, 2024 21:55
script to clean up files in the bazel cache
#! /bin/bash -e
#
# clean up everything in CACHE_DIR last accessed more than DAYS days ago.
# also removes files with bogus timestamps in the future.
#
# -----------------------------------------------------------------------
# Copyright 2021 Todd Derr (todd.derr@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@jobsamuel
jobsamuel / cors-cloud-storage.sh
Created April 26, 2019 12:52
How to set up CORS in your Google Cloud Storage Bucket
# Go to "Activate Google Cloud Shell" in https://console.cloud.google.com/home.
echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json
# If you want to restrict the access one or more specific domains, add their URL to the array:
echo '[{"origin": ["https://yourdomain.com"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json
# Set CORS config.
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME
# Verify if everything is OK.
@algal
algal / Zipping.swift
Created February 17, 2019 01:18
Zip files on iOS, without using external libraries and without interoperating with the low-level Compression framework
// Zipping.swift
// known-good: Swift 4.2
// Alexis Gallagher
import Foundation
public extension URL {
/// Creates a zip archive of the file or folder represented by this URL and returns a references to the zipped file
///
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@tomaszpolanski
tomaszpolanski / Movie.kt
Last active June 28, 2022 21:04
Parcelize testing
import android.annotation.SuppressLint
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@SuppressLint("ParcelCreator") // IntelliJ Issue https://youtrack.jetbrains.com/issue/KT-19300
@Parcelize
data class Movie(val title: String) : Parcelable
@Pulimet
Pulimet / AdbCommands
Last active April 26, 2024 13:34
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@ncmiller
ncmiller / HOWTO_LinuxKernelQemu.md
Last active April 16, 2024 17:37
How to build the Linux kernel and test changes locally in qemu

This is the process I followed on my Fedora 23 host machine to build a small/minimal vanilla Linux kernel and test in Qemu (based on this blog post). This will provide a safe sandbox in which to test kernel changes, and is generally faster than developing natively on the host machine. Qemu will boot the kernel image directly in the emulated system.

Install required build tools on host machine

sudo dnf install ncurses-devel kernel-devel kernel-headers gcc gcc-c++ git qemu openssl-devel glibc-static

Prepare a working space for kernel development

@chicagobuss
chicagobuss / conf_core-site.xml
Last active June 11, 2022 11:53
How to get spark 1.6.0 with hadoop 2.6 working with s3
<configuration>
<property>
<name>fs.s3a.access.key</name>
<description>AWS access key ID. Omit for Role-based authentication.</description>
<value>YOUR_ACCESS_KEY</value>
</property>
<property>
<name>fs.s3a.secret.key</name>
<description>AWS secret key. Omit for Role-based authentication.</description>
JedWatson/classnames (2650855 dls, 1465 stars)
yannickcr/eslint-plugin-react (2077066 dls, 710 stars)
rackt/react-router (1833204 dls, 9050 stars)
facebook/react-dom (782024 dls, 33044 stars)
gaearon/react-hot-loader (708042 dls, 3250 stars)
rackt/redux (568969 dls, 10743 stars)
rackt/react-redux (495498 dls, 1509 stars)
jsdf/coffee-react-transform (463488 dls, 380 stars)
JedWatson/react-input-autosize (455277 dls, 107 stars)
reflux/reflux (393281 dls, 4316 stars)