Skip to content

Instantly share code, notes, and snippets.

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

Diego Gallardo dmgallardo

🏠
Working from home
View GitHub Profile
@dmgallardo
dmgallardo / gist:1753941
Last active September 30, 2015 08:38
HTACCESS: Rewrite rule for shared sites under the same server, add a 2nd site under a subfolder
#Create a folder subdomain, and make it work like a domain.
RewriteCond %{HTTP_HOST} mysite.com.ar
RewriteCond %{REQUEST_URI} !^/mysite #mysite_folder
RewriteRule ^(.*)$ mysite/$1 [L] #mysite_folder
@dmgallardo
dmgallardo / gist:3641950
Created September 5, 2012 18:24
.htaccess How to make a subfolder the main folder for your primary domain
#From: http://support.lunarpages.com/knowledge_bases/article/549
# .htaccess primary domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your primary domain.
@dmgallardo
dmgallardo / curl.md
Last active August 29, 2015 14:23 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@dmgallardo
dmgallardo / multiple_ssh_setting.md
Last active September 2, 2015 21:41 — 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 "[email protected]"
@dmgallardo
dmgallardo / RestControllerTrait.php
Created March 3, 2016 10:44 — forked from mariano-aguero/RestControllerTrait.php
Playing with Laravel Lumen: simple RESTful trait.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait {
/**
* Manage index request
@dmgallardo
dmgallardo / webdevelopermachine.md
Last active August 19, 2016 03:18
Mac web developer apps - New Machine
@dmgallardo
dmgallardo / App Icon and Splash Screen Sizes.md
Last active October 24, 2016 16:06
Phonegap App Icon and Splash Screen Sizes

This is a reference guide for Icons and Splash screen resolutions for Android and iOS Cordova/Phonegap Apps. This guide is only for Mobile Phone Devices.

App Icon Screen Sizes

Webapp

  • 57 px, add as <link rel="apple-touch-icon" href="icon.png">, in the <head> of index.html.

Android (square icons)

  • 192px X 192px (xxxhdpi) (name: 192.png)
  • 144px X 144px (xxhdpi) (name: 144.png)
@dmgallardo
dmgallardo / launch_sublime_from_terminal.markdown
Last active December 16, 2016 13:29 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text from the Mac OS X Terminal

Launch Sublime Text from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@dmgallardo
dmgallardo / nginx.conf
Created February 9, 2017 16:16 — forked from mariano-aguero/nginx.conf
File nginx.conf to use in centos servers
user nginx;
worker_processes 1; #2
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
worker_rlimit_nofile 20000;
events {
worker_connections 10000;
multi_accept on;
accept_mutex on;
@dmgallardo
dmgallardo / docker-cleanup-resources.md
Created December 2, 2019 20:42 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm