Skip to content

Instantly share code, notes, and snippets.

View V3ntus's full-sized avatar
Remind me to code again

Ventus V3ntus

Remind me to code again
View GitHub Profile
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active June 9, 2024 15:08
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m

\u001b is the unicode escape for ESCAPE/ESC, meant to be used in the source of your bot (see ). If you wish to send colored text without using your bot you need to copy the character from the website.

@matthew-carroll
matthew-carroll / dry_layout_stop_gap.dart
Created January 3, 2021 00:39
DryIntrinsicWidth and DryIntrinsicHeight
/// Same as `IntrinsicWidth` except that when this widget is instructed
/// to `computeDryLayout()`, it doesn't invoke that on its child, instead
/// it computes the child's intrinsic width.
///
/// This widget is useful in situations where the `child` does not
/// support dry layout, e.g., `TextField` as of 01/02/2021.
class DryIntrinsicWidth extends SingleChildRenderObjectWidget {
const DryIntrinsicWidth({Key key, Widget child})
: super(key: key, child: child);
@MeguminSama
MeguminSama / Discord Experiments.js
Last active June 7, 2024 14:14
Discord Experiments.js
let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
@slightfoot
slightfoot / stream_text.dart
Last active January 30, 2024 06:45
Streaming Text in Flutter
import 'dart:async';
import 'package:flutter/material.dart';
void main() =>
runApp(MaterialApp(
home: ExampleScreen(),
));
class ExampleScreen extends StatelessWidget {
@kevinwright
kevinwright / proresproxy.sh
Last active February 18, 2024 21:14
Use ffmpeg to build prores proxies for Premiere Pro
#!/usr/bin/env bash
# Usage notes
# ===========
#
# proxy_watermark.png needs to be in the same directory as the script
# download from here: http://whoismatt.com/images/2016/7-july/adobe_proxy_logo.png
#
# on OSX, both pv and ffmpeg will need to be installed via homebrew
@steven2358
steven2358 / ffmpeg.md
Last active June 12, 2024 01:10
FFmpeg cheat sheet
@kuanghan
kuanghan / athena_cuda.md
Last active May 24, 2024 21:55
Install NVIDIA driver & CUDA inside an LXC container running Ubuntu 16.04

Installing NVIDIA Driver & CUDA inside an LXC container running Ubuntu 16.04 on a neuroscience computing server.

Introduction: I was trying to run some neuroscience image processing commands that uses NVIDIA GPU. The challenge is that most of our computation will be run inside an LXC container running Ubuntu 16.04 (the host runs Ubuntu 16.04 as well). Installing the NVIDIA driver on the host is not so hard, but doing it inside the LXC container is much more challenging.

I already have an unprivileged container running, so I will not repeat the steps to create an LXC container here.

Our graphics card is NVIDIA GeForce GTX 1080 Ti.

Here are the main steps:

@mcescalante
mcescalante / sqlite3json.py
Last active November 27, 2021 20:11
Python SQLite3 INSERT & SELECT for JSON
import sqlite3
import json
conn = sqlite3.connect('test.db')
c = conn.cursor()
# Insert values
c.execute('''insert into data values(?)''', (json.dumps({'test':'test2'}),))
conn.commit()