Skip to content

Instantly share code, notes, and snippets.

View yuchuanfeng's full-sized avatar
🌴
On vacation

chuanfeng yuchuanfeng

🌴
On vacation
View GitHub Profile
@yuchuanfeng
yuchuanfeng / git-deployment.md
Created May 14, 2019 07:54 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@yuchuanfeng
yuchuanfeng / nested_scroll_view.dart
Created October 16, 2018 03:56 — forked from collinjackson/nested_scroll_view.dart
nestedscrollview example
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() {
runApp(new TestApp());
}
@yuchuanfeng
yuchuanfeng / gist:5d2a9f0cbe48a40b265fba1c52305c6b
Created October 11, 2018 06:52 — forked from karanvs/gist:44599464f72988b138f5bc783f423b07
A solution to putting multiple ListViews inside a ScrollView in Flutter
return new Scaffold(
appBar: new AppBar(
title: new Text("Project Details"),
backgroundColor: Colors.blue[800]),
body:
new CustomScrollView(
slivers: <Widget>[
new SliverPadding(padding: const EdgeInsets.only(left: 10.0,right: 10.0,
top: 10.0,bottom: 0.0),
sliver: new SliverList(delegate:
@yuchuanfeng
yuchuanfeng / impbcopy.m
Created May 8, 2018 04:49 — forked from mwender/impbcopy.m
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@yuchuanfeng
yuchuanfeng / install-swift-ubuntu.md
Last active January 11, 2018 07:13 — forked from Azoy/install-swift-ubuntu.md
Guide on how to install Swift on Ubuntu

Install Swift on Ubuntu

Requirements

  1. Ubuntu 14.04, 16.04, or 16.10

Step 1 - Dependencies

  1. Open up terminal
  2. Install core deps: sudo apt-get install clang libicu-dev git

Step 1.1 - Ubuntu 14.04 Clang

@yuchuanfeng
yuchuanfeng / throttle-SourceKitService
Created December 8, 2017 07:45 — forked from pyrtsa/throttle-SourceKitService
Script to keep SourceKitService from eating up all OS resources
#!/bin/bash
limit="${1-10000000}";
echo "Keeping SourceKitService below $limit KiB of virtual memory."
echo "Hit ^C to quit."
while true; do
sleep 1;
p=`pgrep ^SourceKitService$`
if [ -n "$p" ]; then
vsz=`ps -o vsz -p "$p" | tail -1`
'''
Break on Objective-C 's method using its address'
'''
import shlex
import lldb
import re
def breakonmethod(debugger, command, exe_ctx,result, internal_dict):
args=shlex.split(command)
Class=args[0]
Method=args[1]
@yuchuanfeng
yuchuanfeng / Screenshot.swift
Created March 15, 2017 07:55 — forked from nitrag/Screenshot.swift
This will allow you to take a screenshot of a UIView, but more importantly only a section of that view
//
// Screenshot.swift
//
// 1) Take a picture of a UIView
// 2) Take a picture of a UIView's subframe. EG. Fullscreen UIView with a
// small square box in the middle, it will only save what's visible in the box frame
// but not the box itself
import Foundation
import UIKit