Skip to content

Instantly share code, notes, and snippets.

@cristobal-io
cristobal-io / jsontToEnv.js
Created October 7, 2023 14:16
convert JSON to .env format
const { execSync } = require('child_process');
function jsonToEnv(json) {
const data = JSON.parse(json);
let envData = '';
for (const [key, value] of Object.entries(data)) {
envData += `${key}=${value}\n`;
}
return envData;
}
@cristobal-io
cristobal-io / git_workflow.md
Last active May 23, 2023 08:41
Mermaid Git Workflow

From Mermaid

%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': { 'showBranches': true, 'showCommitLabel': false,'mainBranchName': 'develop'}} }%%

gitGraph:
  checkout develop
  commit
 branch hotfix/1.0.1
@cristobal-io
cristobal-io / variables.scss
Created December 9, 2022 19:00
variables file from ui-lux
// Colors
$white: #fff;
$black: #000;
$black-1f: #1f1f24;
$black-22: #222222;
$black-33: #333333;
$black-55: #555555;
$grey-1d: #1d1d1d;
$grey-f2: #f2f2f2;
$grey-f6: #f6f6f6;
$fontsPathUrl: '/assets/' !default; // This works with imp start
@font-face {
font-family: 'Great Vibes';
src: url($fontsPathUrl + 'fonts/GreatVibes-Regular.woff2') format('woff2'),
url($fontsPathUrl + 'fonts/GreatVibes-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
@cristobal-io
cristobal-io / multiple_ssh_setting.md
Created June 4, 2020 22:26 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@cristobal-io
cristobal-io / github_bitbucket_multiple_ssh_keys.md
Created April 17, 2020 17:53 — forked from yinzara/github_bitbucket_multiple_ssh_keys.md
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

Keybase proof

I hereby claim:

  • I am cristobal-io on github.
  • I am cristobal_io (https://keybase.io/cristobal_io) on keybase.
  • I have a public key ASAiu9FQO1z-yB_aHEY0yZz0xZWhxirzGyrqoepjJy2MUgo

To claim this, I am signing this object:

@cristobal-io
cristobal-io / post-merge
Created December 5, 2018 20:43 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@cristobal-io
cristobal-io / color-conversion-algorithms.js
Created July 19, 2018 14:37 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@cristobal-io
cristobal-io / ApacheHTTPSConfig.md
Created December 14, 2017 15:27 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys: