Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- GitHub



  Accessing Reddit top posts using OAuth

Previously one can use the https://www.reddit.com/r/rprogramming/top.json API to access one subreddit's top posts. This API doesn't require any access token to fetch the data. However, this API may not work all the time. Reddit may block the API's request if it finds that you are using a script or some app which accesses the API now and then. For an app or script which needs to fetch the data routinely, what should we do? Reddit provides one method which can be used to fetch this kind of to...

   REDDIT,OAUTH,TOP POSTS,HOT POSTS     2023-12-16 07:24:14

  What is pjax and why we should use it?

What is pjax? Now many websites such as Facebook, Twitter support one browsing style which is when you click one link on their sites, the page will not be redirected, instead only the page contents are updated and URL on address bar is changed. This kind of user experience is much better compared to load the whole page with a blink. There is one important component in the above browsing experience, these websites' AJAX refresh support browser history, when refreshing the page, the address on the...

   pjax,AJAX,history     2013-04-23 12:22:37

  Some tricks and tips for using for range in GoLang

GoLang provides two major ways to loop through elements of array, slice and map. They are for and for range. Many people find that for range is very convenient when don't care about the index of the element. In this post, some tricks and tips would be talked about regarding for range. 1. Loop and get pointer of each element Assume there is a code snippet like below which is to get the pointer of each element in an array and create a new array with the corresponding pointer. arr := [2]int{1, 2} r...

   POINTER,FOR LOOP,GOLANG,FOR RANGE     2020-03-08 01:07:00

  Install Open webOS on Linux

HP has just released its first beta version of the webOS, It is said the user experience of webOS is quite impressive, so I immediately had it installed on my PC. There are two versions of Beta release,one embedded version and one Ubuntu version. I briefly share my installation experience of webOS in Linux. In the official document, it says "By 'Linux' we mean 'Ubuntu Linux'", it doesn't support server version and 64 bit version of Ubuntu. Here I use Mint 13. 1. Clone source code from github Add...

   Linux,webOS,Ubuntu,embedded,HP     2012-09-10 19:36:30

  Some frequently used ES6 code snippets

Below are a list of ES6 code snippets which are used frequently. Hope that it will be helpful. 1. Shuffle array elements let arr = [67, true, false, '55'] arr = arr.sort(() => 0.5 - Math.random()) console.log(arr) // [ '55', 67, false, true ] 2. Remove characters which are not numbers const str = 'xieyezi 23213 is 95994 so hansome 223333' const numbers = str.replace(/\D/g, '') console.log(numbers) // 2321395994223333 3. Reverse sequence or words const sentence = 'xieyezi js so handsome, lol.'...

   JAVASCRIPT,ES6,CODE SNIPPET,TIPS     2022-04-10 07:56:07

  Thoughts on Running an Open Source Project

I spoke in the unconference at PHPUK last week, on running an open source project. I thought I would collect together my thoughts into one place before I lose the scratty piece of paper I wrote them down on. I'm not sure I'm the right person to be giving advice exactly, but these are the things that, having been project lead on joind.in for a while, I think are important. Community I love it when people share their code, just make something and publish it, but to my mind it isn't an open...

   Open source,Management,Readme,Community     2012-03-06 05:25:27

  HTML Page Slide Without a Framework

The HTML5 Microzone is presented by DZone and Microsoft to bring you the most interesting and relevant content on emerging web standards.  Experience all that the HTML5 Microzone has to offer on our homepage and check out the cutting edge web development tutorials on Script Junkie, Build My Pinned Site, and the HTML5 DevCenter. I'm working on a little demo mobile application for an upcoming project, and I wanted to add sliding transitions between pag...

   HTML,Slide show,No framework,JavaScript     2012-04-17 06:51:40

  New Features to Look Out for in Xcode 9

When we say Xcode, we mean a designing toolset which is completely packed with features. Using this Xcode, developers can create applications for platforms such as the Apple TV, the iPad, Apple Watch, and the iPhones and even for the Macintosh. The development system for Xcode has a mixture of features. These are called the instrument analysis tool, simulators, and the ever important OS frameworks which are present in the package in a variety of form of tvOS SDKs, iOS SDKs, watchOS SDKs, and the...

   XCODE,IPHONE,XCODE9     2017-09-26 06:31:30

  JavaScript finite state machine

Finite state machine is a very useful design model, it can be used to simulate many events in the world. In short, finite state machine has three features: Number of states is finite At any moment, one object can only be in one state In some condition, it will transfer from one state to another state In JavaScript, finite state machine can be applied in many places. For example, one menu element on a webpage. When the mouse hovers on the menu, the menu will show up, while the mouse moves away...

   JavaScript,Finite state machine,State     2013-09-02 11:00:57

  Understanding PHP's internal function definitions

Welcome to the second part of the “PHP’s Source Code For PHP Developers” series. In the previous part ircmaxell explained where you can find the PHP source code and how it is basically structured and also gave a small introduction to C (as that’s the language PHP is written in). If you missed that post, you probably should read it before starting with this one. What we’ll cover in this article is locating the definitions of internal functions in t...

   PHP,internal function,definition,rationale     2012-03-16 10:46:26