Skip to content

Instantly share code, notes, and snippets.

View c16a's full-sized avatar
😎
Hacking around

Chaitanya Munukutla c16a

😎
Hacking around
View GitHub Profile

Keybase proof

I hereby claim:

  • I am c16a on github.
  • I am c16a (https://keybase.io/c16a) on keybase.
  • I have a public key ASCM39UscHEPlnIZMXZzwto7n-uaBg3_6Nrk7bKDyD1_7Qo

To claim this, I am signing this object:

@c16a
c16a / pom.xml
Created December 22, 2018 09:14
Maven dependency for Zipkin support
<dependency>
<groupId>io.helidon.webserver</groupId>
<artifactId>helidon-webserver-zipkin</artifactId>
</dependency>
@c16a
c16a / Server.java
Created December 22, 2018 08:24
Starter code for Helidon SE
import io.helidon.webserver.Routing;
import io.helidon.webserver.WebServer;
public static void main(String[] args) {
Routing routing = Routing.builder()
.get("/hello", (req, res) -> res.send("Hello World"))
.build();
WebServer.create(routing)
.start();
@c16a
c16a / spawn.kt
Last active June 25, 2018 18:04
Asynchronous programming using higher-order functions in post-2010 languages
fun main() {
async {
print("Printing GeeksQuiz from thread")
}
}
@c16a
c16a / spawn.rs
Last active June 25, 2018 17:57
Parallel threading in Rust
use std::thread;
fn main() {
println!("Before thread");
// fill the vector
let handle =thread::spawn(|| {
println!("Printing GeeksQuiz from threads");
})
println!("After thread");
handle.join().unwrap();
@c16a
c16a / spawn.c
Last active June 25, 2018 17:57
Parallel threading in good-old C
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void *threadFunc(void *vargp)
{
printf("Printing GeeksQuiz from Thread \n");
return NULL;
}
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Animate a point</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=yes' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.css' rel='stylesheet' />
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.21.2.js"></script>
UIAlertController* alert=[UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* yesButton = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
NSLog(@"You pressed Yes, please button");
// call method whatever u need
}];
UIAlertAction* noButton = [UIAlertAction actionWithTitle:@"No"
style:UIAlertActionStyleDefault
@c16a
c16a / main.go
Created August 6, 2017 13:41
Concurrent MySQL with Golang
package main
import "database/sql"
import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/satori/go.uuid"
"math/rand"
"sync"
)
@c16a
c16a / workaround.swift
Last active March 7, 2017 10:22
Swift workaround to solve delay in assigning first UITextField responder in UIKit and erroneous responders
// Add this function to the end of AppDelegate.swift
// Call this function in
// func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
func applyFirstResponder() {
let dummyField = UITextField()
self.window?.addSubView(dummyField)
dummyField.becomeFirstResponder()
dummyField.resignFirstResponder()
dummyField.removeFromSuperview()
}