Skip to content

Instantly share code, notes, and snippets.

@bgloh
bgloh / http_post.java
Last active December 31, 2021 03:48
http post for minecraft java
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public void whenAsynchronousPostRequest_thenCorrect(CommandSender sender) {
JSONObject json = new JSONObject();
JSONObjec child = new JSONObjec();
json.put("PK", "PLAYER");
json.put("SK", "playerID#abc@gmail.com");
json.put("playerID", "abc@gmail.com");
// child json
child.put("age",10);
@bgloh
bgloh / serverless.yml
Created September 24, 2020 23:39 — forked from DavidWells/serverless.yml
DynamoDB custom index serverless.yml example
service: service-name
provider:
name: aws
runtime: nodejs6.10
functions:
myfunc:
handler: handler.myfunc
@bgloh
bgloh / django_angularJs.html
Created January 11, 2019 03:32
Django-AngularJS : csrf token, http Content-Type, $.params
<html ng-app='myApp'>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.js">
</script>
<script
src="https://code.jquery.com/jquery-1.12.4.js"
integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
crossorigin="anonymous"></script>
</head>
@bgloh
bgloh / django_angularJs.html
Created January 11, 2019 03:32
Django-AngularJS : csrf token, http Content-Type : 'application/x-www-form-urlencoded',
<html ng-app='myApp'>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.js">
</script>
<script
src="https://code.jquery.com/jquery-1.12.4.js"
integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
crossorigin="anonymous"></script>
</head>
@bgloh
bgloh / pwmTask.h
Created December 4, 2018 06:14
pwmTask header file
#ifndef PWMTASK_H_
#define PWMTASK_H_
/* Initializes the PwmLed Task and creates all TI-RTOS objects */
extern void PwmTask_create(void);
#endif /* PWMTASK_H_ */
@bgloh
bgloh / pwmTask.c
Created December 4, 2018 06:13
pwm Task
/***** Includes *****/
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Event.h>
@bgloh
bgloh / eventTask.c
Created November 28, 2018 23:24
TI RTOS cc2650 Event Task
/*******************************************************************************
* INCLUDES
*/
#include <string.h>
#include <stdio.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Task.h>
@bgloh
bgloh / **.c
Created November 25, 2018 15:59
how to use System_printf() in CCS
1. Add this to .cfg
/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
System.SupportProxy = SysMin;
2. Add this to Task()
System_printf("event1 is posted:%d \n",i++);
System_flush();
@bgloh
bgloh / gist:5780f86dbdd4b3e913d1b08a5c5c50a0
Created November 25, 2018 15:07
how to create one time clock, Event handler
// Create one-shot clocks for internal periodic events.
Util_constructClock(&myPeriodicClock0,my_clockHandler0,MYCLOCK0_PERIOD,0,false, MY_EVENT0);
Clock_Handle h_myClock0 = Clock_handle(&myPeriodicClock0);
Clock_start(h_myClock0);
// To use Event module add the following to the .cfg
var evt = xdc.useModule('ti.sysbios.knl.Event');
// Creation of Event instance
@bgloh
bgloh / 0x00000.bin
Created February 11, 2018 18:34 — forked from ajfisher/0x00000.bin
ESP8266 Transparent bridge to J5