Skip to content

Instantly share code, notes, and snippets.

View spiritinlife's full-sized avatar

George Chailazopoulos spiritinlife

View GitHub Profile
@nhancv
nhancv / intl_arb2csv.py
Created August 6, 2020 04:58
convert arb to csv for flutter intl
import csv
import json
import os
cmd_path = os.path.dirname(__file__)
# Init file
intl_name = 'intl_vi'
arb_file_path = cmd_path + '/' + 'lib/l10n/' + intl_name + '.arb'
csv_file_path = cmd_path + '/' + 'lib/l10n/' + intl_name + '.csv'
@raveesh-me
raveesh-me / main.dart
Created July 7, 2018 00:22
An inherited callback pattern to change InheritedWidget state in flutter
import 'package:flutter/material.dart';
import 'package:flutter_login_manager/splash_screen.dart';
import 'package:flutter_login_manager/model/login_info.dart';
import 'package:flutter_login_manager/model/login.dart' as loginManager;
import 'package:flutter_login_manager/home_screen.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
@keyboardr
keyboardr / HeadlessFragment.java
Last active December 31, 2021 01:05
A file template for creating a headless Fragment. The attach() methods add the fragment to the parent if it doesn't already exist and returns the attached fragment. The methods ensure that the parent implements the parent interface. If needed, parameters may be added to the attach() methods to supply fragment arguments.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
#parse("File Header.java")
public class ${NAME} extends Fragment {
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName();
@spiritinlife
spiritinlife / Custom Android Animation for illusion of filling something or progressing
Last active August 29, 2015 14:02
The concept of this Animation is to make an illusion of something getting filled or progressed.In this example i use two images, one is a black box and the other is a red one.The goal is to reveal the red box my animating the dissapearance of the black one.This custom view can be used in any layout with no configuration.
package gr.spiritinlife.AnimationBlackToRedBox;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
@JedWatson
JedWatson / keystone.js
Created February 24, 2014 16:00
Example of how to integrate node-i18n with a KeystoneJS app (using yo keystone generated site as a basis) - see https://github.com/mashpie/i18n-node for more docs.
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
require('dotenv')().load();
// Require keystone and i18n
var keystone = require('keystone'),
i18n= require('i18n');
// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: