• ABOUT
  • GITHUB
  • ARCHIVES
  • FRIENDS
  • RSS
  • How to Execute JS Promises in Series

    Aug 25, 2017

    So let’s say you have this say(msg) function:

    1
    2
    3
    4
    5
    6
    7
    8
    const say = (msg) => {
    return new Promise((res, rej) => {
    console.log(msg);
    setTimeout(() => {
    res();
    }, 1000);
    });
    };

    And you want to call it with different parameters in series. What would you do?

    ...more
  • Yomu Development Blog #0

    Apr 20, 2017

    As I mentioned in my Medium post (in Chinese), I’ve been working on a side project called Yomu (and in case you wonder, the name is an Otaku term from the anime 境界の彼方).

    ...more
  • Getting Video Thumbnail in Cocoa

    Mar 5, 2017

    I’ve been working on a video streaming macOS app for a while, and I need to find a way to get the thumbnail of a bunch of videos. Just like many other things, there are multiple ways of achieving this. So in this post I will show you the two solutions I found and do some comparison.

    ...more
  • Browse and Resolve Bonjour Services on iOS

    Jan 3, 2017

    This is a very quick post.

    In one of my current projects I wrote a macOS app that runs an embedded HTTP server and publishes itself as a Bonjour service. This can be easily done with an awesome library called CocoaHTTPServer. And from an iOS app that works with this macOS app, I need to browse available Bonjour services in current network and resolve their IP addresses and ports.

    ...more
  • Alfred Workflow That cd iTerm2 to Current Finder Directory

    Dec 29, 2016

    Note that, to be able to use custom workflow in Alfred, you need to purchase Alfred Powerpack. Otherwise this post may not be helpful to you.

    If you are a developer using macOS you are probably using iTerm2 as your main Terminal. Won’t it be nice if you can launch iTerm2 and automatically cd into the current Finder directory?

    Well there are some existing tools for this, but these solutions require you to drag and drop the folder into an AppleScript or right click on the folder. But I don’t want to move my fingers away from keyboard, which affects my productivity. As a heavy user of Alfred.app, I think it would be great if I could do this with Alfred.

    ...more
  • Camera Vibration in Canvas Based Unity Game

    Dec 12, 2016

    Currently I am maintaining a 2D Unity game (check it out here if you are interested). I was trying to implement a feature that when the user gives illegal input, the whole screen would shake (or vibrate if you would) for a while.

    ...more
  • OctoMonitor - GitHub Status Monitor

    Dec 4, 2016

    promotion

    During my final exam revision week I’ve spent two days to work on a side project called OctoMonitor, an iOS app that notifies you with the changes of status of GitHub services.

    ...more
  • Notification From Terminal

    Oct 15, 2016

    If you are a developer like me, you probably spend lot of time in your terminal. I am sure you’ve encountered situations where you have a long-running process to run in terminal but you don’t have the time to wait for it to finish (e.g., for iOS developer the pod repo update command for CocoaPods takes a long time). Won’t it be nice if your terminal can trigger a notification in notification center when the process is done?

    ...more
  • Go Reactive

    Oct 10, 2016

    stream

    So recently I’ve got tired of writing massive nested callback blocks in Objective-C (like what they called “callback hell” in JS community), and I decided to give reactive programming in Cocoa a try.

    ...more
  • New Theme Based on Apollo

    Aug 12, 2016

    The previous theme I used was NexT. It’s a great theme with good documentation, high customizability and a neat layout. The problem is, it’s way too clean, while I want more style in my blog. Besides, being the most starred Hexo theme on GitHub, NexT is used by many tech blogs, but I really don’t want my blog to look like others’.

    ...more
NEXT

© 2015 - 2017 Alex Ling, powered by Hexo and Yuno-Apollo.