Skip to content

Instantly share code, notes, and snippets.

View ramon-sg's full-sized avatar

Ramón Soto ramon-sg

  • Concepción, Chile
View GitHub Profile
@acidtib
acidtib / readme.md
Created August 28, 2023 17:56
kamal + github actions

Example of Kamal deployment from Github Actions.

Add your applications .env variables to the Github repo as a repository secret, you can find this under the repo settings => secrets and variables => actions

https://github.com/username/repo_name/settings/secrets/actions

you are going to need an ssh private key that your deployment server is aware of (add public key to servers .ssh/authorized_keys) and add the ssh private key as a repo secret

create action workflows

@intrnl
intrnl / usefetch.js
Last active November 24, 2023 04:26
import { useState, useEffect } from 'preact/hooks'
/**
* @param {RequestInfo} url
* @param {RequestInit} opts
* @returns {useFetchObject}
*/
function useFetch (url, opts) {
const [response, setResponse] = useState(undefined)
const [error, setError] = useState(undefined)
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active July 23, 2024 21:53
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

require "uri"
require "http/client"
require "file_utils"
print "🤖 Fetching sentry files..."
# Fetch sentry.cr
sentry_uri = "https://raw.githubusercontent.com/samueleaton/sentry/49a9a9cf1cdd87f0156206322df198c988132b6f/src/sentry.cr"
fetch_sentry_response = HTTP::Client.get sentry_uri
@andrewhao
andrewhao / 01.ex
Last active January 26, 2021 16:57
Lightweight Elixir dependency injection
module MyApp.MyModule do
@my_collaborating_module Application.get_env(:my_app, :my_collaborating_module)
def perform() do
@my_collaborating_module.do_something()
end
end

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 24, 2024 05:17
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rhernandog
rhernandog / regiones-provincias-comunas.json
Last active October 14, 2021 14:40
Archivo en formato JSON con las regiones de Chile, sus provincias y las respectivas comunas de cada provincia.
[
{
"region": "Arica y Parinacota",
"region_number": "XV",
"region_iso_3166_2": "CL-AP",
"provincias": [
{
"name": "Arica",
"comunas": [
{
@Geek-MD
Geek-MD / qemu_osx_rpi_raspbian_jessie.sh
Last active December 30, 2020 10:51 — forked from hfreire/qemu_osx_rpi_raspbian_jessie.sh
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (Sierra)
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install QEMU OSX port with ARM support
brew install qemu
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
brew install wget
wget https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie