Skip to content

Instantly share code, notes, and snippets.

View KenjiTakahashi's full-sized avatar
😮
Dunno

Karol Woźniak KenjiTakahashi

😮
Dunno
View GitHub Profile
@valorad
valorad / InstallingXRDP.md
Created June 5, 2022 13:18
Installing xrdp

Ubuntu:

sudo apt install xrdp 
sudo adduser xrdp ssl-cert 
sudo systemctl restart xrdp

Fedora:

@ReeganExE
ReeganExE / post-json.go
Created February 15, 2020 08:00
Sample POST json in Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
@craigmurray1120
craigmurray1120 / rest-api-code-generator-list.md
Last active November 18, 2022 09:54
List of REST API code generator
@mustafaturan
mustafaturan / chunk.go
Created February 5, 2019 07:00
Go / Chunk Slice
# https://play.golang.org/p/JxqibtHkuO-
func chunkBy(items []string, chunkSize int) (chunks [][]string) {
for chunkSize < len(items) {
items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize])
}
return append(chunks, items)
}
@blackcater
blackcater / diagrams.md
Created July 6, 2018 16:45
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@eagleEggs
eagleEggs / plotly_offline_graph_cli
Last active August 11, 2018 02:42
plotly offline graph from command line
Setting up the following will enable running a notebook from CLI and create a plotly image from the generated graph:
CLI:
sudo jupyter nbconvert --execute notebook.ipynb
Python:
At top of notebook: offline.init_notebook_mode()
After defining data and figure:
offline.iplot(fig, filename='graph', image='png')
@emmiep
emmiep / rollup.config.js
Created April 18, 2018 16:28
Rollup manual chunks for vendor bundle
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
const env = process.env.NODE_ENV || 'development';
export default {
input: [
'src/index.js'
@ghostbear
ghostbear / Spotify - How to reduce and limit the cache size (Windows - Mac).md
Last active April 9, 2024 11:07
[Spotify] How to limit the cache size (Windows/Mac OS)

Credit to MadHatter

WINDOWS

Use your text editor of choice or if you don't have one use Windows Notepad
Opening with Notepad may or may not result in a fancy mess

  1. Close Spotify
  2. Open File Explorer and paste the following into the address bar %appdata%/Spotify¤
  3. Open the file named prefs with your text editor
  4. Change the numeric value following storage.size= . If storage.size= doesn't exist add it manually to the end of the file and assign numeric value. This value represents megabytes. One gigabyte equals 1024 megabytes. In the end, it should look something like this storage.size=1024
  5. Save the file
@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active May 4, 2024 01:12
setup L2TP IPSEC VPN in archlinux using NetworkManager
@lummie
lummie / FileServerWith404.go
Last active February 24, 2023 22:46
A wrapper for GOs http.FileServer that allows a custom 404 handler to be assigned
package middleware
import (
"net/http"
"os"
"path"
"strings"
)
// FSHandler404 provides the function signature for passing to the FileServerWith404