Skip to content

Instantly share code, notes, and snippets.

@szobov
szobov / config.el
Created January 18, 2021 07:48
emacs: Google-style docstring in python
(defun python-google-docstring ()
"Generate google-style docstring for python."
(interactive)
(if (region-active-p)
(progn
(call-process-region (region-beginning) (region-end) "python3" nil t t "/home/szobov/bin/scripts/format-g-docs.py")
(message "Docs are generated")
(deactivate-mark))
(message "No region active; can't generate docs!"))
)
@zhjuncai
zhjuncai / z_demo_structdescr.abap
Last active March 19, 2024 03:39
abap demo use of cl_abap_structdescr to get list of structure component definition
*&---------------------------------------------------------------------*
*& report z_demo_structdescr
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report z_demo_structdescr.
// Processing code by Etienne Jacob
// motion blur template by beesandbombs, explanation/article: https://bleuje.com/tutorial6/
// See the license information at the end of this file.
// see result here: https://mastodon.social/@bleuje/111706027080323463
//////////////////////////////////////////////////////////////////////////////
// Start of template
int[][] result; // pixel colors buffer for motion blur
@Joelkang
Joelkang / Dockerfile
Last active March 19, 2024 03:31
Dockerfile to create a container with the right deps to quantize models with MLC for CUDA 12.1
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 as deps
SHELL ["/bin/bash", "--login", "-c"]
# Step 1. Set up Ubuntu
RUN apt update && apt install --yes wget ssh git git-lfs vim
# NOTE: libcuda.so.1 doesn't exist in NVIDIA's base image, link the stub file to work around
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so.1
WORKDIR /root
@halcat0x15a
halcat0x15a / pipe.md
Last active March 19, 2024 03:30
Pipe

Pipeモナドの紹介

Scalaの記事です。Haskellはあまり書けません。

Iterateeの複雑さから開放されたいのでPipe系ライブラリ使いましょうという記事です。

Iterateeとの比較や簡単な使い方についてつらつらと書いていきます。

Iterateeについて

@minhcasi
minhcasi / Flutter Clean.md
Last active March 19, 2024 03:27
These are common issues on Flutter and solutions to fix

Quick Clean Cache

  1. Open android studio Tools->Flutter->Clean
  2. Go to File -> Invalidate Caches / Restart
  3. Or open terminal run "flutter clean"
  4. Remove pubspec.lock
  5. Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP

Or open the terminal and try this script:

flutter clean
@matthewzring
matthewzring / markdown-text-101.md
Last active March 19, 2024 03:27
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@jegfish
jegfish / example_db.py
Last active March 19, 2024 03:26
Example code for connecting to and using a postgres database using discord.py and asyncpg.
# asyncpg docs: https://magicstack.github.io/asyncpg/current/
# This uses discord.py rewrite branch and .format(). If you are using the async branch of discord.py, it shouldn't matter much
# as only 'await ctx.send()' is something you should need to change. If you are using python 3.6+, you can use f strings as opposed to
# .format() for increased efficiency.
import discord
from discord.ext import commands
import asyncio
import asyncpg
@bUxEE
bUxEE / find_string.php
Last active March 19, 2024 03:25
find string in file (search in directory and subdirectories) php
<?php
$string = 'stringToSearch';
$dir = new RecursiveDirectoryIterator('folder');
foreach (new RecursiveIteratorIterator($dir) as $filename => $file) {
//$thename = $file->getFilename(); //uncomment this line and next to print names of all files scanned
//echo $thename.'<br />';
$content = file_get_contents($file->getPathname());
if (strpos($content, $string) !== false) {
@boyter
boyter / guid.py
Created November 8, 2022 05:18
Simply Python3 script to create guids that contain only 1337 speak
import random
def _replace(word):
replacements = {
'l': '1',
'i': '1',
's': '5',
't': '7',
'g': '9',
'q': '9',