Skip to content

Instantly share code, notes, and snippets.

@suplo
suplo / MySQL_macOS_Sierra.md
Created July 5, 2017 15:13 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@suplo
suplo / redis_cheatsheet.bash
Created June 25, 2017 08:53 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@suplo
suplo / simple.html
Created June 18, 2017 08:42
Simple html file
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>first sentence</p>
<p>second sentence</p>
<div><span>another sentence</span></div>
</body>
</html>
@suplo
suplo / exec.sh
Created June 14, 2017 02:42
exec code
#!/usr/bin/env bash
# execute command
$@
# check status
STATUS=$?
if [ $STATUS == 0 ]; then
echo "Command '$@' completed successfully"
else
@suplo
suplo / README.md
Created June 13, 2017 01:30 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@suplo
suplo / regex.md
Created June 7, 2017 10:43
Url regex
@suplo
suplo / example.ts
Created June 5, 2017 06:30 — forked from wonderful-panda/example.ts
Asynchronous test of vue with mocha
import * as Vue from "vue";
import * as assert from "power-assert";
function nextTick() {
return new Promise((resolve, _) => Vue.nextTick(resolve));
}
describe("vue component tests", function() {
it("works properly", async function() { // don't use `done` with async function
const vm = new Vue({ ... });
@suplo
suplo / test.html
Created May 22, 2017 01:44
innerText vs innerHTML, textContent
`<p id="test"> This element contains <span>an inner span</span>. </p>`
The values of these properties of the "test" paragraph will be:
* innerText: "This element contains an inner span." :point_left: Just the text, trimmed and space-collapsed.
* innerHtml: " This element contains <span>an inner span</span>. " :point_left: All spacing and inner element tags.
* textContent: " This element contains an inner span. " :point_left: Spacing, but no tags.

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@suplo
suplo / commands.md
Created April 6, 2017 08:33
useful commands

flush dns cache

dscacheutil -flushcache; sudo killall -HUP mDNSResponder