Skip to content

Instantly share code, notes, and snippets.

View mchampaneri's full-sized avatar
😎
Exploring open source

Manish Champaneri mchampaneri

😎
Exploring open source
View GitHub Profile
@mchampaneri
mchampaneri / c.h
Created May 2, 2020 16:21 — forked from chai2010/c.h
Golang cgo objective-c cocoa button callback
#include <Cocoa/Cocoa.h>
extern void ButtonClick(void);
@interface GoPasser : NSObject
+ (void)buttonClick:(id)sender; // this should call the cgo function defined in main.go
@end
void StartApp(void);
@mchampaneri
mchampaneri / example.go
Created May 2, 2020 06:39 — forked from chai2010/example.go
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@mchampaneri
mchampaneri / _service.md
Created April 5, 2018 06:23 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@mchampaneri
mchampaneri / facebook-auth.go
Created December 15, 2017 10:21 — forked from anonymous/facebook-auth.go
facebook oauth
////////////////////////////// Routes /////////////////////////////////////////
routes.HandleFunc("/fb/auth",fbHandler)
//This route will process response returned from the facebook Oauth process
routes.HandleFunc("/fb/callback",fbCallbackHandler)
//////////////////////////// FbOauth Handler //////////////////////////////////
func fbHandler(w http.ResponseWriter, r *http.Request) {
@mchampaneri
mchampaneri / oauth-for-google-api.go
Created November 27, 2017 06:29 — forked from anonymous/oauth-for-google-api.go
Use google api using Oauth
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"