Skip to content

Instantly share code, notes, and snippets.

@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 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@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({ ... });

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 / README.md
Created February 24, 2017 01:12 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.
@suplo
suplo / music.md
Created February 9, 2017 06:11 — forked from staltz/music.md
coding music

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

Notice

This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@suplo
suplo / FRP iOS Learning resources.md
Created September 16, 2016 02:53 — forked from JaviLorbada/FRP iOS Learning resources.md
The best FRP iOS resources.

Videos

@suplo
suplo / fix-homebrew-npm.md
Created August 22, 2016 00:41 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@suplo
suplo / gist:e2388fe31e10ac537f480f80bffee633
Created August 8, 2016 00:12 — forked from rtrouton/gist:f92f263414aaeb946e54
Install Xcode command line tools on 10.7.x - 10.10.x. Tested on 10.7.5, 10.8.5, 10.9.5 and 10.10.2.
#!/bin/bash
# Installing the Xcode command line tools on 10.7.x or higher
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
# Installing the latest Xcode command line tools on 10.9.x or higher
if [[ "$osx_vers" -ge 9 ]]; then