Skip to content

Instantly share code, notes, and snippets.

Avatar
🌈
Show me the code!

João Moreno joaomoreno

🌈
Show me the code!
View GitHub Profile
@joaomoreno
joaomoreno / config.xlaunch
Last active Jan 21, 2021
Selfhosting VS Code on WSL
View config.xlaunch
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="MultiWindow" ClientMode="NoClient" LocalClient="False" Display="0" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="" Wgl="True" DisableAC="True" XDMCPTerminate="False"/>
@joaomoreno
joaomoreno / README.md
Last active Sep 23, 2019
Plot CPU temperatures with
View README.md

This plots the CPU temperature of the past 2 minutes in the terminal using spark.

Example run:

current: 58.0
▅▅▄▅▅▅▃▃▃▂▂▂▁▂▂▁▂▂▂▂▂▂▂▂▃▃▃▃▄▃▄▃▅▃▅▄▅▅▆█▆██▆▆█▆
@joaomoreno
joaomoreno / index.html
Created Dec 4, 2018
Electron Fiddle Gist
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
@joaomoreno
joaomoreno / index.html
Created Dec 4, 2018
Electron Fiddle Gist
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
@joaomoreno
joaomoreno / radiotray-ng-now-playing.sh
Created Sep 13, 2018
Radiotray-NG Now Playing Script
View radiotray-ng-now-playing.sh
#!/bin/sh
META=`dbus-send --print-reply --dest=com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state 2> /dev/null`
STATUS=$(echo $META | sed 's/^.*"state"\s*:\s*"\([^"]*\)".*$/\1/')
if [[ "$STATUS" == "playing" ]]; then
ARTIST=$(echo $META | sed 's/^.*"artist"\s*:\s*"\([^"]*\)".*$/\1/')
TITLE=$(echo $META | sed 's/^.*"title"\s*:\s*"\([^"]*\)".*$/\1/')
echo "$ARTIST - $TITLE"
fi
@joaomoreno
joaomoreno / index.html
Created Aug 2, 2018
Electron Fiddle Gist
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<style>
html, body, #container {
width: 100%;
height: 100%;
padding: 0;
@joaomoreno
joaomoreno / README.md
Last active Mar 12, 2021
VS Code Insiders Updater for Linux
View README.md

VS Code Insiders Updater for Linux

This script will download and replace ~/Applications/VSCode-linux-x64 with the latest VS Code Insiders.

gif

Install

  1. Install jq: https://stedolan.github.io/jq/download/
  2. Place update-code somewhere in your PATH
@joaomoreno
joaomoreno / ..Git PR Aliases.md
Last active Jun 4, 2021 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment
View ..Git PR Aliases.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and merges main into it
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
View bug.cpp
#include "stdafx.h"
#include <iostream>
#include <chrono>
#include <thread>
int main()
{
while (true) {
std::cout << "sleeping for 500ms" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
View settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Fira Code iScript",
"editor.fontSize": 14,
"editor.lineHeight": 21,
"workbench.settings.openDefaultSettings": false,
"terminal.integrated.fontSize": 13,
"editor.tabSize": 2,
"editor.insertSpaces": false,
"files.trimTrailingWhitespace": true,