Skip to content

Instantly share code, notes, and snippets.

View nagarakesh4's full-sized avatar
🚊
{ props.description }

Venkata nagarakesh4

🚊
{ props.description }
  • United States
View GitHub Profile
@nagarakesh4
nagarakesh4 / github-proxy-client.js
Created March 16, 2022 12:32 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* 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}`
}
})
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();
@nagarakesh4
nagarakesh4 / async-handling.js
Last active August 26, 2018 19:42
different ways to execute async code in js
//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
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.
@nagarakesh4
nagarakesh4 / ItemClickSupport.java
Created August 4, 2016 18:20 — forked from nesquena/ItemClickSupport.java
Click handling for RecyclerView
/*
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
}
});