Skip to content

Instantly share code, notes, and snippets.

View ggand0's full-sized avatar
💭
getting shit done

Gota Gando ggand0

💭
getting shit done
View GitHub Profile
ubuntu@gando_theano:~/Tars$ python -m unittest Tars.tests.test_distribution_samles
Traceback (most recent call last):
File "/home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/unittest/__main__.py", line 12, in <module>
main(module=None)
File "/home/ubuntu/.pyenv/versions/2.7.10/lib/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
@ggand0
ggand0 / gist:5773e292b0b3990195edad7bd35a4c64
Last active March 24, 2017 05:04
Preventing importing modules in Python
# see: http://stackoverflow.com/questions/1350466/preventing-python-code-from-importing-certain-modules
>>> import tensorflow
>>> tensorflow.contrib
<tensorflow._LazyContribLoader object at 0x1130b9050>
>>> tensorflow.contrib.layers
<module 'tensorflow.contrib.layers' from '/Users/pentiumx/.pyenv/versions/2.7.10/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.pyc'>
>>> import sys
>>> del tensorflow.contrib.layers
>>> sys.modules['tensorflow.contrib.layers']=None
@ggand0
ggand0 / gist:9f5230ae384796244136ea089da8d5e4
Created January 24, 2025 08:27
Animated mAP in information retrieval example with manim
from manim import *
from manim.utils.color import rgb_to_color
# Set custom resolution
config.pixel_width = 1600
config.pixel_height = 1200
# Tailwind colors
teal_correct = rgb_to_color((0.129, 0.588, 0.588)) # Teal for relevant items
grey_incorrect = GREY # Grey for irrelevant items
@ggand0
ggand0 / pr_anim.py
Last active February 10, 2025 17:37
precision-recall curve visualization for information retrieval
from manim import *
import numpy as np
config.pixel_width = 1280
config.pixel_height = 720
# Define retrieval sequences
retrieval_sequences = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], # High Precision, High Recall
[1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1], # Balanced Retrieval
@ggand0
ggand0 / main.rs
Last active April 2, 2025 01:38
The first commit in my image viewer project with Iced 0.10.0 (snippet for blog post)
use iced::{
button, Button, Column, Element, Image, Length, Row, Sandbox, Settings, Text,
Container
};
use iced::alignment::{Horizontal, Vertical};
// Define the application state
#[derive(Default)]
struct ImageViewer {
image_path: String,
@ggand0
ggand0 / privacy_policy.txt
Last active April 28, 2025 18:37
ViewSkater Privacy Policy
Privacy Policy
ViewSkater does not collect any personal data.
If you have any questions about this privacy policy, please contact us at viewskater@ggando.me.
Effective Date: April 29, 2025
@ggand0
ggand0 / upload_macos_build.sh
Last active May 10, 2025 07:35
Automates bundling, signing, packaging, and uploading a macOS .app (built with Rust) to App Store Connect using Transporter.
#!/bin/bash
set -euo pipefail
# Constants — change as needed
APP_NAME="<YOUR APP NAME>"
BINARY_NAME="<YOUR BINARY NAME>"
BUNDLE_ID="<com.yourorgname.appname>"
VERSION_SHORT="0.1.0"
TEAM_ID="<TEAM ID>"
DEV_NAME="3rd Party Mac Developer Application: <YOUR NAME> ($TEAM_ID)"