Skip to content

Instantly share code, notes, and snippets.

View c3333's full-sized avatar
💭
I may be slow to respond.

c3333

💭
I may be slow to respond.
View GitHub Profile
diff --git a/src/main/java/com/archos/mediacenter/video/player/Player.java b/src/main/java/com/archos/mediacenter/video/player/Player.java
index f86ced1..f678777 100644
--- a/src/main/java/com/archos/mediacenter/video/player/Player.java
+++ b/src/main/java/com/archos/mediacenter/video/player/Player.java
@@ -45,6 +45,8 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
+import android.view.Display.Mode;
+
@c3333
c3333 / minification.md
Created January 6, 2021 16:44 — forked from gaearon/minification.md
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@c3333
c3333 / index.html
Created January 6, 2021 16:42 — forked from gaearon/index.html
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
{
"globals": {
"Array": false,
"ArrayBuffer": false,
"Boolean": false,
"constructor": false,
"DataView": false,
"Date": false,
"decodeURI": false,
"decodeURIComponent": false,
@c3333
c3333 / f1_score.py
Created November 14, 2020 17:07 — forked from SuperShinyEyes/f1_score.py
F1 score in PyTorch
def f1_loss(y_true:torch.Tensor, y_pred:torch.Tensor, is_training=False) -> torch.Tensor:
'''Calculate F1 score. Can work with gpu tensors
The original implmentation is written by Michal Haltuf on Kaggle.
Returns
-------
torch.Tensor
`ndim` == 1. 0 <= val <= 1
@c3333
c3333 / gen-edit-lists.py
Created September 3, 2020 19:38 — forked from ntrrgc/gen-edit-lists.py
Generate crazy MP4 edit lists to be added to media files for testing.
#!/usr/bin/python3
#
# Generate crazy MP4 edit lists to be added to media files for testing.
#
# 1. Modify the timescales below with the actual values from the MP4 file.
#
# 2. Run the following commands to patch the file with Bento:
#
# # Remove previously existing edit list (optional, only if there is some)
# mp4edit --remove moov/trak/edts original.mp4 patched1.mp4
@c3333
c3333 / asciidecodeerror.py
Created July 22, 2020 15:02 — forked from miraculixx/asciidecodeerror.py
Tired of Python's UnicodeDeocodeError, ascii codec can't decode? Here's how to fix it, once and for all.
# Python ascii codec can't decode and unicode mess
#
# check this out https://pythonhosted.org/kitchen/unicode-frustrations.html
# and this http://www.joelonsoftware.com/articles/Unicode.html
#
# The short of it is this
# 1. If you can, always set PYTHONIOENCODING=utf8 before you start your python programs.
# 2. If you can't or you can't ensure this, always use the following lambda _u to get unicode text
# whereever you convert to strings (str.format, str % etc.)
#