Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
So much going on right now!

Jimmy Adaro jimmyadaro

💬
So much going on right now!
View GitHub Profile
@jimmyadaro
jimmyadaro / packages.cson
Created Nov 11, 2020
Packages list for Atom's "package-sync" package
View packages.cson
packages: [
"atom-bracket-highlight"
"auto-update-packages"
"busy-signal"
"color-picker"
"emmet"
"file-icons"
"file-templates"
"highlight-line"
"highlight-selected"
@jimmyadaro
jimmyadaro / retinajs-onerror.html
Created Jun 28, 2020
Image with retina.js fallback "onerror"
View retinajs-onerror.html
<!-- This will include a "data-rjs" attribute on the PNG (or JPG) error fallback in case the SVG failed to load -->
<!-- See: https://github.com/strues/retinajs -->
<img src="/path/to/some.svg" onerror="this.src='/path/to/some.png'; this.data-rjs='2'; this.onerror=null;">
@jimmyadaro
jimmyadaro / .zshrc
Created Jun 7, 2020
OhMyZSH config file
View .zshrc
# Remove everything from Docker system
alias dockerpurge='docker system prune --all --force --volumes'
# Man I hate DS_Store files so much...
alias rds='find . -name '.DS_Store' -type f -delete && echo ".DS_Store files removed!"'
# Open the hosts file with Atom (really useful for VirtualHosts)
alias hosts='atom /private/etc/hosts'
# Go to htdocs
@jimmyadaro
jimmyadaro / bash-concat-example.sh
Created Sep 16, 2019
Concat function return with string for "read -p"
View bash-concat-example.sh
# DESCRIPTION: Simple example of "read -p" and it's usage when trying to print a simple concat from a function and a user input
# Here we'll assume "$folder" comes from a previously-checked "getopts options" loop
# (given as an argument for our script/command option, like "ourscript -f MyFolderName")
##################################################################
##################################################################
##################################################################
# Print a styled "important:" text
@jimmyadaro
jimmyadaro / .bash_profile
Last active Oct 15, 2019
Simple config for macOS' .bash_profile (or .zshrc)
View .bash_profile
# Repeat this line as much as needed so you can access to project's SSH console asap using just the project name
alias <PROJECT_NAME>='ssh -i /Users/<USER_NAME>/.ssh/<KEY_NAME> <USER>@<HOST>'
# Remove everything from Docker system
alias dockerpurge='docker system prune --all --force --volumes'
# Man I hate DS_Store files so much...
alias rds='find . -name '.DS_Store' -type f -delete && echo ".DS_Store files removed!"'
# Open a new terminal window on the same location as the current one is
@jimmyadaro
jimmyadaro / deploy.php
Created Jun 6, 2019
Deployer config base
View deploy.php
<?php
namespace Deployer;
require 'recipe/common.php';
// Project name
set('application', 'App Name');
// Project repository
set('repository', 'git@git-provider.com:repo-name/project-name.git');
@jimmyadaro
jimmyadaro / gulpfile.js
Last active Jun 27, 2020
Gulp with local HTTPS
View gulpfile.js
// If you're using XAMPP on macOS, you can use "Secure-Vhost"
// @link: https://github.com/jimmyadaro/secure-vhost
var local_dev_url = "my-site.local",
path_to_local_dev_key = "/path/to/Secure-Vhost/"+local_dev_url+"/cert.key",
path_to_local_dev_cert = "/path/to/Secure-Vhost/"+local_dev_url+"/cert.crt";
// ...
browserSync.init({
@jimmyadaro
jimmyadaro / key_as_var.php
Created May 1, 2019
Use an array key as a new variable
View key_as_var.php
<?php
$my_array = array(
"foo" => "bar",
"quick" => "fox"
);
foreach($my_array as $k => $v) {
${$k} = $v;
}
@jimmyadaro
jimmyadaro / Jimmy.terminal
Last active Jun 10, 2019
macOS Terminal Config
View Jimmy.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NHMCAwIDAgMUYwIDAg
MAAQAYACgAbTFBUNFhcYVE5TSURVTlNJQ0MQB4ADgAXSGg0bHFdOUy5kYXRhTxEMSAAA
View keymap.cson
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
You can’t perform that action at this time.