Skip to content

Instantly share code, notes, and snippets.

@tatsumoto-ren
tatsumoto-ren / subs.md
Last active May 13, 2024 02:16
Japanese Subtitles

📓 Table of Contents 📚 Resources ✉️ Chat


kitsunekko.net jp subtitles

A large repository of japanese subtitles that is updated reasonably often and has a clean design.| The most popular one, you can upload your own subs.| Often have to be retimed.

#EXTM3U url-tvg="https://iptvx.one/EPG"
#EXTINF:-1, O-la-la
http://31.148.48.15:80/O-la-la/index.m3u8?token=test
#EXTINF:-1, Erox
http://94.229.250.73:8008/play/a002
#EXTINF:-1, Playboy
http://190.11.225.124:5000/live/playboy_hd/playlist.m3u8
#EXTINF:-1 tvg-logo="http://wow-model.com/wp-content/uploads/2017/09/visit-x-tv.jpg", Visit-X
http://stream.visit-x.tv:1935/vxtv/live_720p/playlist.m3u8
#EXTINF:-1, Шелк
@tanaikech
tanaikech / submit.md
Last active May 13, 2024 02:14
Workaround: Automatically Installing OnEdit Trigger to Copied Google Spreadsheet using Google Apps Script

Workaround: Automatically Installing OnEdit Trigger to Copied Google Spreadsheet using Google Apps Script

This is a workaround for automatically installing the OnEdit trigger to the copied Google Spreadsheet using Google Apps Script.

The sample situation for this workaround is as follows.

  • You have a Google Spreadsheet.
  • Your Spreadsheet is shared with a user as the writer.
  • Your Spreadsheet has a button for executing a script for copying the active Spreadsheet.
  • Your Spreadsheet has a function installedOnEdit for executing by the installable OnEdit trigger.
@tomschr
tomschr / python-checklist.md
Last active May 13, 2024 02:13
Python Checklist for Clean Code

Programming Checklist for Clean Code in Python

This checklist contains some tips and recommendations sorted into a syntax and a design category.

It should help to overcome common pitfalls.

Syntax

  1. Check your header of your file. It should contain:
@wojteklu
wojteklu / clean_code.md
Last active May 13, 2024 02:13
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@johnynek
johnynek / almosttailrec.scala
Last active May 13, 2024 02:10
A generalization of tail recursion for stack safety in scala
/*
* Consider a simple recursive function like:
* f(x) = if (x > 1) f(x - 1) + x
* else 0
*
* This function isn't tail recursive (it could be, but let's set that aside for a moment).
* How can we mechanically, which is to say without thinking about it, convert this into a stack safe recursion?
* An approach is to model everything that happens after the recursion as a continuation, and build up that
* continuation in a stack safe manner. Here is some example code:
*/
@koute
koute / opengl3_hello.c
Created November 9, 2013 23:16
Minimal SDL2 + OpenGL3 example.
/*
Minimal SDL2 + OpenGL3 example.
Author: https://github.com/koute
This file is in the public domain; you can do whatever you want with it.
In case the concept of public domain doesn't exist in your jurisdiction
you can also use this code under the terms of Creative Commons CC0 license,
either version 1.0 or (at your option) any later version; for details see:
http://creativecommons.org/publicdomain/zero/1.0/
@jordandee
jordandee / sdl2_opengl.cpp
Last active May 13, 2024 02:03
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@T1T4N
T1T4N / generate-xcode-compilation-database.md
Last active May 13, 2024 02:09
Generate a JSON Compilation Database from an Xcode project

Introduction

A JSON compilation database is a very handy output format which is parsed and used by many development tools. Unfortunately for us Apple Developers, it is not straightforward to generate one from within Xcode, as it is (probably) not Apple's priority and therefore there is no toggle/switch/setting that can be easily enabled to get this information.

There is however a solution, thanks to Apple using Clang/LLVM as their main toolchain.

Implementation

The standard way to generate this with clang would be to use the -MJ flag and give it a file name that typically corresponds to the input file. Using this flag indirectly through Xcode is hard, given that we're not aware of all the other arguments when a compiler call is executed.

However, there is a second hidden/badly documented LLVM flag: -gen-cdb-fragment-path - it is implemented in terms of -MJ and has the same functionality, but it's argument in contrast is an output directory.

@calebrob6
calebrob6 / running_stats_in_torch.py
Last active May 13, 2024 02:01
A class for computing online mean and variance of multi-dimensional arrays in PyTorch (i.e. for computing per-channel stats over large image datasets).
import torch
class RunningStatsButFast(torch.nn.Module):
def __init__(self, shape, dims):
"""Initializes the RunningStatsButFast method.
A PyTorch module that can be put on the GPU and calculate the multidimensional
mean and variance of inputs online in a numerically stable way. This is useful
for calculating the channel-wise mean and variance of a big dataset because you
don't have to load the entire dataset into memory.