Skip to content

Instantly share code, notes, and snippets.

View Solido's full-sized avatar
💙

Robert Felker Solido

💙
View GitHub Profile
@gd3kr
gd3kr / script.js
Created February 15, 2024 06:30
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
@lewtun
lewtun / sft_trainer.py
Last active November 3, 2024 14:10
Fine-tuning Mistral 7B with TRL & DeepSpeed ZeRO-3
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py),
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs.
#
# Usage:
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate`
# - Install deepspeed: `pip install deepspeed==0.9.5`
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git
# - Clone the repo: git clone github.com/huggingface/trl.git
# - Copy this Gist into trl/examples/scripts
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py
@slightfoot
slightfoot / dropdown_popup.dart
Last active August 30, 2021 06:33
Custom Dropdown Popup Menu Example - Custom Enum, Theming, Extending Existing API, Animations, Transitions, Routes, Custom shadows, borders and painting. Based on https://dribbble.com/shots/2369431-Daily-UI-027-Dropdown
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:vector_math/vector_math_64.dart' show radians;
void main() => runApp(ExampleApp());
class ExampleItem {
static const Pineapples = ExampleItem._('Pineapples');
static const Watermelons = ExampleItem._('Watermelons');
static const StarFruit = ExampleItem._('Star Fruit');
@slightfoot
slightfoot / swipe_button.dart
Created December 9, 2018 01:02
Flutter Swipe Button Demo
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
void main() => runApp(SwipeDemoApp());
class SwipeDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@rodydavis
rodydavis / Fastfile
Last active August 18, 2022 14:44
Top-level Fastfile for Flutter
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@slightfoot
slightfoot / squircle.dart
Last active November 4, 2024 08:16
Flutter Squircle Shape
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Squircle',
home: new Scaffold(
@matanlurey
matanlurey / BowlingKtTest.kt
Created May 11, 2017 01:12 — forked from miquelbeltran/BowlingKtTest.kt
Bowling Kata Dart vs Kotlin
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
internal class BowlingKtTest {
@Test
fun `score is 0 when the player did not knock down any pins`() {
assertEquals(0, Array(20, { 0 }).toList().score())
}
@Test
@branflake2267
branflake2267 / main.dart
Last active April 6, 2018 16:35
Flutter - The Infinite ListView - YouTube episode source code...
import 'dart:async';
import 'package:MyListViewApplication/models.dart';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
final ThemeData _themeData = new ThemeData(
primaryColor: Colors.blue,
@branflake2267
branflake2267 / main.dart
Last active February 20, 2024 08:57
Flutter - The Hero Animation - YouTube episode source code...
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
/// Root MaterialApp
class MyApp extends StatelessWidget {
var _routes = <String, WidgetBuilder>{
"/anotherPage": (BuildContext context) =>
@fabiomsr
fabiomsr / app_bar.dart
Last active December 9, 2018 16:16
Flutter DecoratedBox
DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: const FractionalOffset(0.5, 0.6),
end: const FractionalOffset(0.5, 1.0),
colors: <Color>[const Color(0x00000000), const Color(0x70000000)]
)
)
)