Skip to content

Instantly share code, notes, and snippets.

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

Edgardo Ramírez SoldierCorp

🏠
Working from home
View GitHub Profile
@SoldierCorp
SoldierCorp / Dockerfile
Created January 28, 2019 21:36
Dockerfile to create a small container for Golang
############################
# STEP 1 build executable binary
############################
FROM golang:alpine as builder
# Install git + SSL ca certificates.
# Git is required for fetching the dependencies.
# Ca-certificates is required to call HTTPS endpoints.
RUN apk update && apk add --no-cache git ca-certificates gcc g++ libc-dev && update-ca-certificates
# Create appuser
RUN adduser -D -g '' appuser
@SoldierCorp
SoldierCorp / Readme.md
Created January 3, 2019 04:00
Example of readme.md file

This guide is a template that contains steps to install the project, technologies used, folder structure, etc.

  • /: Page to show the home or main page
  • /blog: Page for blog
  • /contact: Page for contact
@SoldierCorp
SoldierCorp / app.js
Last active September 20, 2018 16:11
svg-sprite-loader issue
/* src/app.js */
// Styles
import 'normalize.css';
import 'styles/_app.scss';
$(document).ready(() => {
require('scripts/ga-events');
});
@SoldierCorp
SoldierCorp / main.js
Created February 15, 2016 03:14
Javascript nl2br
function nl2br(str) {
var break_tag = '<br>';
return (str + '').replace(/([^>rn]?)(rn|nr|r|n)/g, '' + break_tag + '');
}
@SoldierCorp
SoldierCorp / main.js
Created February 15, 2016 03:10
Javascript ucfirst
var string = 'github';
string = string[0].toUpperCase() + string.slice(1);
console.log(string); //Github
@SoldierCorp
SoldierCorp / IndustryTableSeeder.php
Last active May 24, 2021 08:48
Laravel Industries Table Seeder of LinkedIn API
<?php
use Illuminate\Database\Seeder;
use App\Industry;
class IndustryTableSeeder extends Seeder {
public function run()
{
DB::table('industries')->truncate();

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g
@SoldierCorp
SoldierCorp / index.html
Created May 31, 2014 03:31
Uso básico de jQuery ajax con PHP /// How works jQuery ajax with PHP (basic usage)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ejemplo PHP con jQuery Ajax</title>
<!-- Bootstrap-->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
@SoldierCorp
SoldierCorp / index.html
Created March 28, 2014 00:37
Delete/remove file with PHP and jQuery Ajax
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Eliminar archivo con PHP y jQuery Ajax</title>
<!-- Bootstrap-->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- jQuery-->
@SoldierCorp
SoldierCorp / gist:9777123
Created March 26, 2014 04:54
Input type password like Internet Explorer
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>