Skip to content

Instantly share code, notes, and snippets.

View smapira's full-sized avatar

smapira smapira

View GitHub Profile
@fernandoaleman
fernandoaleman / mysql2-m1.md
Last active April 22, 2024 23:15
How to install mysql2 gem on m1 Mac

Problem

Installing mysql2 gem errors on Apple silicon M1, M2 or M3 Mac running macOS Sonoma.

Solution

Make sure mysql-client, openssl and zstd are installed on Mac via Homebrew.

Replace mysql-client with whichever mysql package you are using

@idleberg
idleberg / vscode-macos-context-menu.md
Last active May 1, 2024 12:01
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@adamnemecek
adamnemecek / launch.json
Last active March 17, 2023 13:15
VSCode Rust debugging on macOS config
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
"args": [],
"cwd": "${workspaceRoot}",
@gambala
gambala / Makefile
Last active December 22, 2021 22:26
Makefile for Rails
# https://stackoverflow.com/a/14061796/2237879
#
# This hack allows you to run make commands with any set of arguments.
#
# For example, these lines are the same:
# > make g devise:install
# > bundle exec rails generate devise:install
# And these:
# > make add-migration add_deleted_at_to_users deleted_at:datetime
# > bundle exec rails g migration add_deleted_at_to_users deleted_at:datetime
@frankrausch
frankrausch / change-speed-of-mp3.sh
Last active April 21, 2024 07:06
Slow down or speed up all MP3 files in a folder with FFmpeg.
#/bin/sh
speed="0.7"
mkdir "speed-${speed}x"
for f in *.mp3
do ffmpeg -i "$f" -filter:a "atempo=${speed}" "./speed-${speed}x/$f"
done
@nguyentruongky
nguyentruongky / Gradient_border_button.md
Last active May 31, 2023 00:00
A library to create gradient border button

How to draw a gradient border button?

My Problem

Last week, my partner showed me his design for our application. Everything is great, easily implemented with some custom controls. But wait, something is not in my knowledge.

A button with gradient border. Never try it before. Up to now, I just created gradient background views 2 times in previous projects. Googled and found some good results.

@Mikulas
Mikulas / Dockerfile
Last active March 11, 2022 12:34
Docker image PHP 7.1 alpine with extensions
FROM php:7.1-fpm-alpine
RUN apk add --update \
autoconf \
g++ \
libtool \
make \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
@parmentf
parmentf / GitCommitEmoji.md
Last active May 2, 2024 20:29
Git Commit message Emoji
@nashirox
nashirox / rails-validates.rb
Last active April 7, 2024 08:07
Rubyのバリデーション用正規表現集
#
# 数字
#
# 全て数値(全角)
/\A[0-9]+\z/
# 全て数値(半角)
/\A[0-9]+\z/
@gokulkrishh
gokulkrishh / media-query.css
Last active April 26, 2024 10:32
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */