Skip to content

Instantly share code, notes, and snippets.

@ogawa0071
ogawa0071 / deploy.sh
Last active April 28, 2024 00:17
WordPress and MySQL with Fly.io (ALWAYS FREE)
fly apps create ogawa0071-mysql
fly deploy --config mysql.toml
# fly apps destroy ogawa0071-mysql -y
fly apps create ogawa0071-wordpress
fly deploy --config wordpress.toml
# fly apps destroy ogawa0071-wordpress -y
@AHaymond
AHaymond / gist:25587a93094fdffdcdbfeaa90f21337c
Last active April 28, 2024 00:16
Setting up Arch Linux LXC on ProxMox
1. Edit the mirror list located at /etc/pacman.d/mirrorlist and uncomment a preferred mirror (preferrably closest to you)
2. Initialize Pacman GPG Keys
- $> pacman-key --init
- $> pacman-key --populate archlinux
- $> pacman-key --refresh-keys -u --keyserver hkps.pool.sks-keyservers.net
*The use of the --keyserver flag is due to an error that currently occurs when using the default keyserver
3. Reinstall Arch keyring
- $> pacman -S archlinux-keyring
4. Install Yay (if desired)
- Create a user (you cannot run makepkg as root, you must be signed in as a user)
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 00:15
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@domske
domske / safari-fix-overflow-border-radius.md
Last active April 28, 2024 00:15
Bugfix (Workaround) for Safari (iOS): Border radius with overflow hidden does not work as expected.

There is a bug in Safari when using border-radius and overflow: hidden. Especially when applying transform to a child. In this case, overflow: hidden does not always work. The child ignores the border radius and overflows. It's a very old bug. And sadly it seems that it will never be fixed. Anyway, we can't wait for it.

There are some workaround. We need to place the element with the overflow attribute into a stacking context. I've tested the following workarounds on the latest version of iOS (14.4). You can choose what you want. But you should search the web for the particular attribute. (e.g. will-change should be rarely used. See docs)

Use this on the element with overflow: hidden and border-radius:

@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@VinDuv
VinDuv / atalk-linux.md
Last active April 28, 2024 00:10
AppleTalk on Linux issues and fixes

AppleTalk on Linux

The appletalk Linux module provides support for AppleTalk sockets and routing, allowing the Netatalk tools to work properly. There are, however, some issues with the current implementation.

Issues resolved in current versions
import urllib.request
import re
EMOJI_TEST_FILENAME = "emoji-test.txt"
EMOJI_DATA_URL = "https://unicode.org/Public/emoji/14.0/emoji-test.txt"
def download_latest_emoji_test_data() :
response = urllib.request.urlopen(EMOJI_DATA_URL)
emoji_test_file = response.read()
with open(EMOJI_TEST_FILENAME, "wb") as tmp_file:
@chranderson
chranderson / nvmCommands.js
Last active April 28, 2024 00:07
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active April 28, 2024 00:05
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation