This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Ultra lightweight Github REST Client */ | |
| // original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const token = 'github-token-here' | |
| const githubClient = generateAPI('https://api.github.com', { | |
| headers: { | |
| 'User-Agent': 'xyz', | |
| 'Authorization': `bearer ${token}` | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) { | |
| String a = "1,2;3\n4;5;6"; | |
| String[] line = a.split("\\n"); | |
| for(String l: line) { | |
| Pattern pattern = Pattern.compile("([0-9])([,;]?)([0-9])([^^]*)"); | |
| Matcher matcher = pattern.matcher(l); | |
| matcher.find(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Callbacks: call backs helps JS to run Async code so that it can continue to execute the rest of the code | |
| const button = document.getElementById("fetchUserBtn"); | |
| const div = document.getElementById("userDetailsDiv"); | |
| const setDivContent = content => div.textContent = content; | |
| const checkAuth = cb => { | |
| setDivContent("Checking Auth..."); | |
| setTimeout(() => { //replace with network call | |
| cb(true); //authenticate successfully |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OpenWhisk is an event driven distributed compute system. | |
| There are actions, triggers and rules in OpenWhisk that contribute to event driven function as a service system. | |
| OpenWhisk is an event-driven compute platform that executes code in response to events or direct invocations. | |
| Examples of events include changes to database records, IoT sensor readings that exceed a certain temperature, new code commits to | |
| a GitHub repository, or simple HTTP requests from web or mobile apps. Events from external and internal event sources are channeled | |
| through a trigger, and rules allow actions to react to these events. | |
| Actions can be small snippets of Javascript or Swift code, or custom binaries embedded in a Docker container. | |
| Actions in OpenWhisk are instantly deployed and executed whenever a trigger fires. | |
| The more triggers fire, the more actions get invoked. If no trigger fires, no action code is running, so there is no cost. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/ | |
| USAGE: | |
| ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() { | |
| @Override | |
| public void onItemClicked(RecyclerView recyclerView, int position, View v) { | |
| // do it | |
| } | |
| }); |