Skip to content

Instantly share code, notes, and snippets.

View timnew's full-sized avatar

TimNew timnew

View GitHub Profile
@timnew
timnew / dart_generic_experiment.dart
Created May 4, 2021 03:53
Dart Generic Experiment
class Beacon<T>{}
class ExtendBeacon extends Beacon<String> {
}
class MixinBeacon with Beacon<String>{
}
class ChildMixinBeacon extends MixinBeacon{}
import 'package:flutter/material.dart';
void main() async {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: MyApp(),
),
),
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
debugShowCheckedModeBanner: false,
@timnew
timnew / IndexedTrackingScrollController.dart
Last active January 2, 2024 13:54
Flutter Scrollable Controller which jump to given index
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:timnew_reader/features/App/common.dart';
class IndexedTrackingScrollController extends TrackingScrollController {
final GlobalKey sliverListKey = GlobalKey();
@timnew
timnew / git clean branches
Last active March 24, 2020 14:33
Shell command to manage .gitignore file
alias git-clean-squashed='basebr=${BASE:=master}; git checkout -q $basebr && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base $basebr $branch) && [[ $(git cherry $basebr $(git commit-tree $(git rev-parse $branch\^{tree}) -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done'
alias git-clean-merged='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
alias gbcm='git-clean-merged'
alias gbcs='git-clean-squashed'
alias gbca='before_branches=$(git branch);git-clean-merged;git-clean-squashed;after_branches=$(git branch);diff <(echo "$before_branches") <(echo "$after_branches")'
module JsonConvertible
extend ActiveSupport::Concern
included do
unless instance_methods(true).include?(:members) # Support Struct
def self.members(*attributes)
@members = [] if @members.nil?
unless attributes.empty?
attr_accessor(*attributes)
@timnew
timnew / script.py
Created March 31, 2018 13:26
TimNew's BitSlicer Multiple Code Block Script
#Edit Infinite Aether!
#Introduction to scripting: https://github.com/zorgiepoo/Bit-Slicer/wiki/Introduction-to-Scripting
from bitslicer import VirtualMemoryError, DebuggerError
def locateSignature(signature):
debug.log("Searching signature...")
scanResult = vm.scanByteString(signature)
if len(scanResult) == 0:
debug.log("Signature cannot be found.")
@timnew
timnew / bit_slicer_cheat_template.code_injection.py
Last active March 29, 2019 11:34
TimNew's BitSlicer Single Code Block Script
#Edit Me!
#Introduction to scripting: https://github.com/zorgiepoo/Bit-Slicer/wiki/Introduction-to-Scripting
from bitslicer import VirtualMemoryError, DebuggerError
def locateSignature(signature):
debug.log("Searching signature...")
scanResult = vm.scanByteString(signature)
if len(scanResult) == 0:
debug.log("Signature cannot be found.")
@timnew
timnew / Infinite AC.py
Last active March 31, 2018 13:23
Creeper World 2.12 Steam Mac Version BitSlicer Scripts
#Edit Infinite AC!
#Introduction to scripting: https://github.com/zorgiepoo/Bit-Slicer/wiki/Introduction-to-Scripting
from bitslicer import VirtualMemoryError, DebuggerError
def locateSignature(signature):
debug.log("Searching signature...")
scanResult = vm.scanByteString(signature)
if len(scanResult) == 0:
debug.log("Signature cannot be found.")