Skip to content

Instantly share code, notes, and snippets.

David Lavieri falmar

Block or report user

Report or block falmar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@falmar
falmar / main.go
Created Oct 12, 2019
Update Laravel's migrations varchar to max length of 191 for allowing use of utf8mb4
View main.go
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"os"
"path/filepath"
@falmar
falmar / openssl.MD
Created Feb 22, 2019 — forked from jchandra74/openssl.MD
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window
View openssl.MD

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@falmar
falmar / docker-compose.override.yml
Created Nov 23, 2017
Docker compose files: local + swarm stack
View docker-compose.override.yml
version: '3.4'
services:
mysql:
volumes:
- db:/var/lib/mysql
ports:
- 3306:3306
environment:
- MYSQL_PASSWORD=database_password
@falmar
falmar / docker-clean.md
Created Oct 27, 2017 — forked from kuznero/docker-clean.md
Cleanup docker images and containers after failed builds
View docker-clean.md

Cleanup docker images and containers after failed builds

Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.

#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@falmar
falmar / fedora pkg kit
Last active Oct 22, 2017
Remove package kit from fedora, remove bloat rpm cache files
View fedora pkg kit
from https://bugzilla.redhat.com/show_bug.cgi?id=1306992#c11
pick one
- pkcon refresh force -c -1
- set /etc/PackageKit/PackageKit.conf
# Keep the packages after they have been downloaded
KeepCache=false
@falmar
falmar / CopyToClipboard.jsx
Created Aug 11, 2017 — forked from netsi1964/CopyToClipboard.jsx
ReactJS component: Copy to clipboard
View CopyToClipboard.jsx
class CopyToClipboard extends React.Component {
constructor(props) {
super(props);
}
copy() {
const copyTextarea = this.refs.data;
const { text, onCopy, silent } = this.props;
copyTextarea.value = onCopy.call(this, text);
copyTextarea.select();
View docker-compose.yml
# MYSQL_PASSWORD=... docker-compose up -d
version: '2'
services:
ds:
image: alpine:3.4
command: sh
volumes:
- ./:/usr/share/nginx/html
View password.php
// http://php.net/manual/en/function.password-hash.php
$password = password_hash($string, PASSWORD_BCRYPT, ['cost' => 9]);
// http://php.net/manual/en/function.password-verify.php
$correct = password_verify($string, $password);
@falmar
falmar / nset.php
Last active Aug 7, 2017
Nested Sets in SQL
View nset.php
<?php
// Update the nested set table, reorder all the rows
function leftRightOrder($PDO, $fatherId, $left)
{
if(!is_null($fatherId)) {
$stmt = $PDO->prepare('SELECT id FROM ws_example WHERE parentId = ?');
$stmt->bindValue(1, $fatherId);
} else {
@falmar
falmar / main.go
Created Jul 9, 2016 — forked from nmerouze/main.go
Example for "Build Your Own Web Framework in Go" articles
View main.go
package main
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
You can’t perform that action at this time.