Skip to content

Instantly share code, notes, and snippets.

View rogeriopradoj's full-sized avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@tamsanh
tamsanh / jupyter_cell_notify.py
Created April 6, 2018 03:18
Generate and play a sound in Jupyter Notebook when then cell is run. Useful as notification when a long-running cell is done.
from IPython.lib.display import Audio
import numpy as np
framerate = 4410
play_time_seconds = 3
t = np.linspace(0, play_time_seconds, framerate*play_time_seconds)
audio_data = np.sin(2*np.pi*300*t) + np.sin(2*np.pi*240*t)
Audio(audio_data, rate=framerate, autoplay=True)
@dwgebler
dwgebler / doctrinemap.php
Created April 5, 2018 22:17
Generate Symfony 4 entities + repositories from existing database
<?php
include './vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
class RepoGen extends Doctrine\ORM\Tools\EntityRepositoryGenerator {
protected static $_template =
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active January 30, 2024 12:14
Install NVM, Node.js, Yarn via Homebrew
@opensourcetutorialsnet
opensourcetutorialsnet / gist:51dc12aada3e1f8fc8dd1064d9b78522
Created December 19, 2017 23:53
Startup command parameters to run Docker terminal in cmder
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh" -new_console:d:"C:\Program Files\Docker Toolbox"
@blackgate
blackgate / mbp2011-disable-amd-gpu.md
Last active November 22, 2023 01:23
Macbook Pro 2011 - Disable AMD GPU
@stevekm
stevekm / launchctl_man.md
Last active March 30, 2024 20:02
macOS OS X login items

[source]

This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

    In Terminal, using the man(1) command

Reading manual pages
@ivanrosolen
ivanrosolen / how_to_phpt.md
Last active July 12, 2022 00:53
How To PHPT

How To PHPT

First, let's set up the 'enviroment'.

  • Clone this repo

git clone https://github.com/herdphp/docker-phpqa.git

  • Go to the created folder or the one you especified
@milolav
milolav / Portable_WhatsApp.md
Last active July 23, 2023 12:58
Making WhatsApp desktop application portable

Portable desktop WhatsApp

You start multiple instances of WhatsApp using --user-data-dir flag providing the full path to the directory. For example:

E:\Temp\Whatsapp>WhatsApp.exe --user-data-dir=E:\Temp\Whatsapp\number1

or by creating a shortcut with the flag.

@lpar
lpar / README.md
Last active January 29, 2023 14:09
How to make Hugo (0.20+) generate an Atom feed instead of RSS

The Hugo static site generator sadly still uses the obsolete and badly standardized RSS format.

Here's how to set it up to generate an Atom feed instead. Pretty much all feed readers which understand RSS also understand Atom, except iTunes, and Atom is a better format.

  1. Define an appropriate media type and corresponding output format in config.toml:
@BretFisher
BretFisher / docker-for-mac.md
Last active May 7, 2024 08:34
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1