Skip to content

Instantly share code, notes, and snippets.

View rad182's full-sized avatar
🏠
Working from home

Royce Dy rad182

🏠
Working from home
View GitHub Profile
@rad182
rad182 / mariadb-brew-macos.md
Created March 9, 2023 14:30 — forked from nickcernis/mariadb-brew-macos.md
Install MariaDB with brew on macOS and fix the “access denied” issue

Attempting mysql -u root fails with Access denied for user 'root'@'localhost immediately after doing brew install mariadb and starting mariadb with brew services start mariadb.

To fix it (with MariaDB still running):

  1. sudo mysql then enter your Mac user password
  2. ALTER USER 'root'@'localhost' IDENTIFIED BY 'newrootpassword'; replacing newrootpassword with the password you wish to use for the MariaDB root user.
  3. Ctrl-C to exit mysql.

You should then be able to connect to MariaDB with mysql -u root -p, then entering the root password when prompted.

@rad182
rad182 / README.md
Created September 22, 2021 13:30 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@rad182
rad182 / gist:e0ab10f282f7461769318ccbbe79cda6
Created June 6, 2018 17:15
rnfbsdk share dialog video
const videoURI = "file:///Users/xxx/Library/Developer/CoreSimulator/Devices/1D2A67CE-6DC7-…mp/react-native-image-crop-picker/7BDF6A4A-A2C7-4A7E-8CB3-4FE623C7EDE2.mp4";
const shareContent = {
contentType: 'video',
video: {
localUrl: videoURI,
},
};
ShareDialog.canShow(shareContent)
.then(canShow => {
#!/bin/bash
################################################################################
# Does a mass upgrade of your Homebrew apps and allows you to interactively
# select which Cask apps to upgrade.
#
# ./brew-cask-upgrade.sh "<BREW_EXCLUDES>" "<CASK_EXCLUDES>"
#
# Requirements:
# Homebrew http://brew.sh/
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
import Foundation
public class CredentialHelper {
// MARK: Init
private var host: String
private var protectionSpace: NSURLProtectionSpace
public init(host: String) {
self.host = host
protectionSpace = NSURLProtectionSpace(host: host, port: 0, `protocol`: "http", realm: nil, authenticationMethod: nil)
@rad182
rad182 / GIF-Screencast-OSX.md
Created January 6, 2016 15:32 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@rad182
rad182 / version.sh
Created October 20, 2015 13:56 — forked from osteslag/version.sh
Script for managing build and version numbers using git and agvtool. See link in comments below.
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {
@rad182
rad182 / keybase.md
Last active October 20, 2016 05:35

Keybase proof

I hereby claim:

  • I am rad182 on github.
  • I am rad182 (https://keybase.io/rad182) on keybase.
  • I have a public key ASCzun0dI-mZDrosZkQro5EeV2JxX_XRNZExwA3oHz5UXwo

To claim this, I am signing this object:

#!/usr/bin/env ruby
# Requires ImageMagick: `brew install imagemagick`
# Requires version.sh from https://gist.github.com/osteslag/1089407
#
# Set RGM_STAMP_VERSION_ON_ICONS=1 in your build settings to enable/disable
# stamping on Debug/Relase configurations.
#
# Make base unstamped versions Icon.base.png, &c. in the source tree. The
# script will make stamped versions Icon.png, &c. It relies on Xcode to copy