Skip to content

Instantly share code, notes, and snippets.

Avatar

TimNew timnew

View GitHub Profile
View spinning_flutter.dart
import 'package:flutter/material.dart';
void main() async {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: MyApp(),
),
),
View InfiniteList.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@timnew
timnew / IndexedTrackingScrollController.dart
Last active Oct 27, 2020
Flutter Scrollable Controller which jump to given index
View IndexedTrackingScrollController.dart
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 Mar 24, 2020
Shell command to manage .gitignore file
View git clean branches
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")'
View json_convertible.rb
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 Mar 31, 2018
TimNew's BitSlicer Multiple Code Block Script
View script.py
#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 Mar 29, 2019
TimNew's BitSlicer Single Code Block Script
View bit_slicer_cheat_template.code_injection.py
#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 Mar 31, 2018
Creeper World 2.12 Steam Mac Version BitSlicer Scripts
View Infinite AC.py
#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.")
@timnew
timnew / replace_text_in_clipboard.sh
Created Sep 18, 2017
Automatically replace text in clipboard
View replace_text_in_clipboard.sh
while true; do pbpaste | sed -e "s/name:production-db/\$server-master/g" | sed -e "s/name:production-replicadb/\$server-replica/g" | pbcopy; sleep 1; done
You can’t perform that action at this time.