Skip to content

Instantly share code, notes, and snippets.

View berryp's full-sized avatar
😎

Berry Phillips berryp

😎
  • Seoul, Korea
  • 00:40 (UTC +09:00)
View GitHub Profile
@berryp
berryp / prepare-nix.sh
Last active December 14, 2022 12:30
NixOs pre-installation steps for new VM
#!/bin/bash
set -e
# https://nixos.org/manual/nixos/stable/index.html#sec-installation
###############################################################
# JUST DON'T USE THIS. IT'S NOT FOR YOU.
###############################################################
@berryp
berryp / copy-applications.nix
Created December 3, 2022 09:07
Have nix-darwin installed GUI show up in Spotlight
{ config, lib, pkgs, ... }:
{
# Import this module in your nix-darin config to have applications copied
# to /Applications/Nix Apps instead of being symlinked. GUI apps must be
# added to environment packages, not home-manager for this to work.
system.activationScripts.applications.text = lib.mkForce ''
echo "Setting up /Applications/Nix Apps" >&2
appsSrc="${config.system.build.applications}/Applications/"
baseDir="/Applications/Nix Apps"

Keybase proof

I hereby claim:

  • I am berryp on github.
  • I am berryp (https://keybase.io/berryp) on keybase.
  • I have a public key whose fingerprint is 234D 1F9A F98A C9BD 2A96 B28D 8223 4D65 3810 D474

To claim this, I am signing this object:

2019-08-14 13:26:38.578 IBCocoaTouchImageCatalogTool[28118:2400122] Unable to get image dimensions for file:///Users/berryp/code/salmteo/app/platforms/ios/삶터-직원용/Images.xcassets/LaunchStoryboard.imageset/Default@2x~universal~anyany.png
2019-08-14 13:26:38.612 IBCocoaTouchImageCatalogTool[28118:2400122] Unable to get image dimensions for file:///Users/berryp/code/salmteo/app/platforms/ios/삶터-직원용/Images.xcassets/AppIcon.appiconset/icon-1024.png
2019-08-14 13:26:38.618 IBCocoaTouchImageCatalogTool[28118:2400122] Unable to get image dimensions for file:///Users/berryp/code/salmteo/app/platforms/ios/삶터-직원용/Images.xcassets/AppIcon.appiconset/icon-20.png
2019-08-14 13:26:38.618 IBCocoaTouchImageCatalogTool[28118:2400122] Unable to get image dimensions for file:///Users/berryp/code/salmteo/app/platforms/ios/삶터-직원용/Images.xcassets/AppIcon.appiconset/[email protected]
2019-08-14 13:26:38.619 IBCocoaTouchImageCatalogTool[28118:2400122] Unable to get image dimensions for file:///Users/berryp/code/salmteo/app/platforms/ios/삶
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: myapp-frontend
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
rollingUpdate:
maxUnavailable: 0
@berryp
berryp / docker.py
Created November 15, 2017 10:25
aiodocker with Hyper.sh support
import asyncio
import json
import logging
import os
from pathlib import Path
import re
import ssl
import aiohttp
from yarl import URL

Default values

if somevar is None:
    somevar = somedefaultvar

vs.

NPM Artifactory proxy

NPM reads package names from the first slug ion the URL in the request. Artifactory URLs have a bunch of slugs before the package name. This means that when NPM prints out the package name in case of an error, you don’t get the package name when using Artifactory.

This Nginx config will allow you to proxy requests from a naked path on a local Nginx server to the full Artifactory URL.

Setup

Nginx

Create a file in the current directory called nginx.conf (or any name of your choice, just make sure you use than name in all instructions) and add the following:

package main
import (
"fmt"
"strings"
)
type CategoryList struct {
Categories []Category
}