Skip to content

Instantly share code, notes, and snippets.

View yuchuanfeng's full-sized avatar
🌴
On vacation

chuanfeng yuchuanfeng

🌴
On vacation
View GitHub Profile
// See http://iphonedevwiki.net/index.php/Logos
#import <UIKit/UIKit.h>
#include <dlfcn.h>
NSString *_realBundleID = @"com.google.ios.youtube";
NSString *_bundleIDKey = @"CFBundleIdentifier";
BOOL IsCallFromSystem();
@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:
import Foundation
class CallRollTool {
static private var outMark = 0
static private var inMark = 0
static func call(interval: TimeInterval = 0.5, _ callBack:@escaping (()->())){
outMark += 1
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + interval) {
inMark += 1
@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
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
service mysql restart && bash
@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`
extension Character {
func isHanzi() -> Bool {
if ("\u{4E00}" <= self && self <= "\u{9FA5}") {
return true
}else {
return false
}
}
}