Skip to content

Instantly share code, notes, and snippets.

View Amir-P's full-sized avatar
🎯
Playing Dart

Amir Panahandeh Amir-P

🎯
Playing Dart
View GitHub Profile
@rain-1
rain-1 / LLM.md
Last active October 3, 2024 21:58
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active August 8, 2024 13:26
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
@Amir-P
Amir-P / notification_consumer.dart
Created April 20, 2022 13:37
A `BlocConsumer` like widget for notifications (uses `NotificationBuilder` from `flutter/widgets`)
import 'package:flutter/widgets.dart';
typedef NotificationBuilderCallback<T extends Notification> = Widget Function(
BuildContext context, T? notification);
typedef NotificationCondition<T extends Notification> = bool Function(
T notification);
class NotificationConsumer<T extends Notification> extends StatefulWidget {
final NotificationBuilderCallback<T> builder;
@Amir-P
Amir-P / converter.py
Last active July 25, 2024 16:57
Convert JSON exported contacts from Telegram to vCard (.vcf)
import sys
import json
input_file = sys.argv[1]
output_file = sys.argv[2]
output_file = open(output_file, 'w')
def to_vcf_string(first_name, last_name, phone):
vcf_lines = []
@cristianvasquez
cristianvasquez / kanban_test.dart
Created December 24, 2019 11:53
Example of a drag and drop Kanban in Flutter
import 'dart:collection';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HKAtrialFibrillationDetectionOnboardingCompleted</key>
<integer>1</integer>
<key>HKElectrocardiogramOnboardingCompleted</key>
<integer>3</integer>
</dict>
</plist>
import 'package:flutter/foundation.dart';
/// A class that can be used to derive a value based on data from another
/// Listenable or Listenables.
///
/// The value will be recomputed when the provided [listenable] notifies the
/// listeners that values have changed.
///
/// ### Simple Example
///
@amarion35
amarion35 / tdnn.py
Created October 11, 2018 17:33 — forked from amarioncosmo/tdnn.py
TDNN Layer in Keras
from keras import backend as K
from keras.engine.base_layer import Layer, InputSpec
from keras import activations
from keras.layers.convolutional import _Conv
import numpy as np
class TDNN(_Conv):
# Original TDNN
# A. Waibel, T. Hanazawa, G. Hinton, K. Shikano and K. J. Lang,
# "Phoneme recognition using time-delay neural networks,"
@wojteklu
wojteklu / clean_code.md
Last active October 20, 2024 00:22
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

@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward