Skip to content

Instantly share code, notes, and snippets.

View yyong37's full-sized avatar

yyong yyong37

  • Mars
View GitHub Profile
@yyong37
yyong37 / custom_drawer.dart
Created April 3, 2024 01:26
custom drawer with flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@yyong37
yyong37 / OverlayableContainerOnLongPress_sample.dart
Created February 16, 2024 20:26 — forked from boeledi/OverlayableContainerOnLongPress_sample.dart
How to display an overlay on top of a particular item, present in a Scroll Area, on longPress?
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
///
/// Launch the application
///
runApp(const Application());
}
@yyong37
yyong37 / .bashrc
Created June 10, 2020 05:08 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@yyong37
yyong37 / foomt.go
Created June 29, 2019 07:53 — forked from agrison/foomt.go
Sample Go App to mass insert 1M keys in redis using goroutines and unix socket
package main
import (
"fmt"
"log"
"net"
"runtime"
"sync"
"time"
<?php
// we can use this, make our code simple and short.
class MethodTest
{
public function __call($name, $arguments)
{
// Note: value of $name is case sensitive.
echo "Calling object method '$name' "
<?php
class Singleton {
private $_instance;
private function __construct() {}
private function __clone() {}
@yyong37
yyong37 / Parser.js
Created June 22, 2018 04:58 — forked from Saul-Mirone/MVVM.js
A simple mvvm
class Register {
constructor() {
this.routes = []
}
regist(obj, k, fn) {
const _i = this.routes.find(function(el) {
if((el.key === k || el.key.toString() === k.toString())
&& Object.is(el.obj, obj)) {
return el
class Post extends Component {
constructor () {
super()
this.state = { content: '' }
}
componentWillMount () {
this._loadData()
}
@yyong37
yyong37 / txt2epub.py
Created November 27, 2017 02:57 — forked from scturtle/txt2epub.py
txt to epub
# coding: utf-8
import os
#书籍信息
title='test book'
creator='scturtle'
description='blablablabla'
#章节文件
txtlist=['1.txt','2.txt']
def split(x):
def sp(n,m):
if m>n:
raise StopIteration
else:
for i in range(m,n//2+1):
for l in sp(n-i,i):
yield [i]+l
yield [n]
for i in sp(x,1):