Skip to content

Instantly share code, notes, and snippets.

Junji Zhi junjizhi

Block or report user

Report or block junjizhi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Flutter Table layout with CSV data
import 'package:flutter/material.dart';
import 'package:csv/csv.dart';
import 'dart:async' show Future;
import 'package:flutter/services.dart' show rootBundle;
class TableLayout extends StatefulWidget {
@override
_TableLayoutState createState() => _TableLayoutState();
}
View 1. upgradeable.sol
pragma solidity ^0.4.10;
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
@pdanford
pdanford / README.md
Last active Sep 15, 2019
Applescript to launch iTerm2 Version 3+ from OS X Finder via keyboard shortcut or Toolbar
View README.md

Description

Based on info from http://peterdowns.com/posts/open-iterm-finder-service.html but with modified behavior and fixed to work with iTerm2 version 3 or later. It will not work with older versions of iTerm. The modified behavior is to open a new terminal window for each invocation instead of reusing an already open window. Update - The original author released a build script for the newer iTerm2 versions at https://github.com/peterldowns/iterm2-finder-tools that keeps the original behavior of reusing an open iTerm2 window.

To open iTerm2 at selected folder with keyboard shortcut

  1. Run Automator, select a new Service
  2. Select Utilities -> Double click ‘Run AppleScript’
  3. Service receives selected 'folders' in 'finder.app'
  4. Paste script:
@jackiekazil
jackiekazil / rounding_decimals.md
Last active Sep 6, 2019
How do I round to 2 decimals in python?
View rounding_decimals.md

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@hidsh
hidsh / open-finder.el
Last active Oct 18, 2017
Mac: open folder by Finder from Emacs
View open-finder.el
(defun open-finder-1 (dir file)
(let ((script
(if file
(concat
"tell application \"Finder\"\n"
" set frontmost to true\n"
" make new Finder window to (POSIX file \"" dir "\")\n"
" select file \"" file "\"\n"
"end tell\n")
(concat
You can’t perform that action at this time.