Skip to content

Instantly share code, notes, and snippets.

View LinqLover's full-sized avatar
🎈
Carpe Squeak!

Christoph Thiede LinqLover

🎈
Carpe Squeak!
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@noelbundick
noelbundick / README.md
Last active June 24, 2021 15:51
VS Code remote SSH from terminal

I've got 2 flavors of launching VS Code on remote servers for you

  1. Clean terminal, you know you want to launch code on a remote server. Check out sshcode.sh

  2. You want to launch code on your local machine from inside an existing SSH session. This needs a bit of setup, but seems to work pretty well. Hacks inbound!

  • Set PermitLocalCommand yes in your SSH config (see example)
  • Add a LocalCommand to stash the username, IP, and current directory in a local file when you connect
  • Save hack.sh in your home directory

Now to connect, use the SSH escape sequence (default single tilde ~) along with !command to invoke the script

@daviguima
daviguima / gist-oneliner
Created March 9, 2020 14:06
upload file to gist.github.com using curl
curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' -u mgarciaisaia:mypassword https://api.github.com/gists
# https://stackoverflow.com/questions/34048241/how-to-create-a-gist-on-command-line
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@jstnlvns
jstnlvns / git: gitignore.md
Created November 16, 2018 19:42
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@andre-hartmann
andre-hartmann / main.cpp
Last active July 4, 2023 14:27
QCommandLineParser with subcommands
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QTextStream>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCommandLineParser parser;
parser.setOptionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsOptions);
parser.addPositionalArgument("subcommand",
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active May 14, 2024 00:46
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@tylermakin
tylermakin / Multipart MIME Email.md
Last active May 7, 2024 21:24
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: sender@example.com
To: recipient@example.com
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
@thinrhino
thinrhino / tf-idf.py
Created May 5, 2014 13:09
Calculate tf-idf
# ref: http://www.tfidf.com/
# Example:
# Consider a document containing 100 words wherein the word cat appears 3 times.
# The term frequency (i.e., tf) for cat is then (3 / 100) = 0.03. Now, assume we
# have 10 million documents and the word cat appears in one thousand of these.
# Then, the inverse document frequency (i.e., idf) is calculated as log(10,000,000 / 1,000) = 4.
# Thus, the Tf-idf weight is the product of these quantities: 0.03 * 4 = 0.12.
#
# Hence:
# 1. Calculate term frequency