Skip to content

Instantly share code, notes, and snippets.

View putraxor's full-sized avatar
💭
I may be slow to respond.

Ardiansyah Putra putraxor

💭
I may be slow to respond.
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <snappy-c.h>
// Fungsi C hanya menerima data input
char* compressData(const char* input) {
size_t inputLength = strlen(input);
size_t maxCompressedLength = snappy_max_compressed_length(inputLength);
@putraxor
putraxor / javas_MOD.js
Created December 13, 2020 09:07
VA-MOD sudah di-deobfuscate
var timer_glob_sec = 0,
timer_glob_sec_2 = 0,
prohod = 0,
timer_glob_sec_temp = 0,
okruglit = 0,
kotirovka = 0,
onetiksec_on = 0,
gorizontal_on = 0;
var gorizontmini;
@putraxor
putraxor / analytic_wfm.py
Created April 18, 2020 06:32 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@putraxor
putraxor / compressed_pickle.py
Created January 18, 2020 14:39 — forked from cwidmer/compressed_pickle.py
save/load compressed pickled objects in python
import cPickle
import bz2
def save(filename, myobj):
"""
save object to file using pickle
@param filename: name of destination file
@type filename: str
@putraxor
putraxor / rsi.dart
Created October 17, 2019 05:27
Relative Strength Index implementation in Dart
//Reference: https://www.youtube.com/watch?v=Dt0KQg52c6c
class RSIIndicator {
int n;
RSIIndicator([this.n = 14]);
List<double> calculate({List<double> close}) {
var res = <double>[];
int firstBar = n + 1;
var gain = [];
@putraxor
putraxor / raw_keyboard_widget.dart
Created July 1, 2019 22:50
Flutter widget to handle keyboard for CTRL+C/V/X/A and SHIFT+LEFT/RIGHT selection
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class RawKeyboardWidget extends StatefulWidget {
final Widget child;
RawKeyboardWidget({@required this.child});
@override
@putraxor
putraxor / macapp.go
Created June 24, 2019 10:08 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@putraxor
putraxor / blocs_provider.dart
Created February 7, 2019 12:55
Multiple Blocs Provider for Flutter
import 'package:flutter/material.dart';
import 'package:model/blocs/base_bloc.dart';
/// Used to give [child] and all it's subsequent children access to [blocs].
/// To get a reference to 'SomeBloc' from a child use: BlocsProvider.of<SomeBloc>(context)
class BlocsProvider extends StatefulWidget {
BlocsProvider({Key key, @required this.child, @required this.blocs})
: super(key: key);
final Widget child;
@putraxor
putraxor / autoscroll_text.dart
Created January 28, 2019 06:09
Flutter Marquee Text Widget
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
class AutoScrollText extends StatefulWidget {
final double height;
final List<Widget> items;
AutoScrollText({this.height = 24.0, this.items});
@override
State<StatefulWidget> createState() => new _AutoScrollTextState();
@putraxor
putraxor / custom_error_widget.dart
Created January 25, 2019 09:08
Show user-friendly error page instead of exception in Flutter
Widget getErrorWidget(BuildContext context, FlutterErrorDetails error) {
return Center(
child: Text(
"Error appeared.",
style: Theme.of(context).textTheme.title.copyWith(color: Colors.white),
),
);
}
class MyApp extends StatelessWidget {