Skip to content

Instantly share code, notes, and snippets.

View simonguest's full-sized avatar

Simon Guest simonguest

View GitHub Profile
@simonguest
simonguest / gist:494f3d48690e7f781917df805e97eceb
Created August 14, 2023 17:27
Automatic conda activation for VS Code terminal (inc. changing directories)
# conda-autoactivate for VSCode terminal
export CONDACONFIGDIR=""
if [ -f $PWD/.conda ]; then
export CONDACONFIGDIR=$PWD
conda activate $(cat .conda)
fi
# conda-autoactivate when cd into dir
cd() { builtin cd "$@" &&
if [ -f $PWD/.conda ]; then

Installation

Follow the instructions to install xrdp on Ubuntu, or compile from source, if needed (glyph bugs fixed in 0.99+)

Edit /etc/xdrp/sesman.ini to correctly configure the Xorg path.

echo "gnome-session" > ~/.xsession to correctly setup GNOME environment.

Login

@simonguest
simonguest / settings.json
Created July 6, 2018 23:15
vscode.settings
{
"window.zoomLevel": 0,
"editor.fontSize": 14,
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace",
"editor.lineHeight": 18,
"editor.lineNumbers": "on",
"editor.tabSize":2,
"workbench.colorTheme": "Darcula Theme from IntelliJ",
"terminal.integrated.fontFamily": "Menlo",
"terminal.integrated.fontSize": 14,
@simonguest
simonguest / index.js
Last active July 6, 2018 22:30
Node/Express Boilerplace
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send({ working: true });
});
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Server listening on ${port}`));
@simonguest
simonguest / index.html
Created January 16, 2017 11:06
HTML Template
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@simonguest
simonguest / locker.js
Last active August 29, 2015 14:09
Locker Challenge
var _ = require('underscore');
var LOCKERS = 100;
// close all of the lockers
var lockers = _.range(1, LOCKERS + 1).map(function (i) {
return {number: i, open: false}
});
// open the lockers by student
_.range(1, LOCKERS + 1).map(function (locker) {