Skip to content

Instantly share code, notes, and snippets.

View judepereira's full-sized avatar

Jude Pereira judepereira

View GitHub Profile
@judepereira
judepereira / lessc-idea.sh
Last active February 4, 2016 19:45
A helper to re-compile LESS into CSS for an exploded WAR deployment in IntelliJ IDEA
#!/bin/bash
exploded_artifact_path=/Users/jude/developer/WizRocket/out/artifacts/Dashboard_war_exploded
less=/usr/local/bin/lessc
function update {
target=`echo $1 | sed s/web\\// | sed s/.less/.css/`
echo "Generating $exploded_artifact_path/$target"
$less $1 $exploded_artifact_path/$target
@judepereira
judepereira / MyApplication.java
Created February 10, 2016 08:18
Setting the CleverTap SDK credentials programmatically in Android
package com.wizrocket.br;
import android.annotation.TargetApi;
import android.os.Build;
import com.clevertap.android.sdk.ActivityLifecycleCallback;
import com.clevertap.android.sdk.CleverTapAPI;
public class MyApplication extends android.app.Application {
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
# -*- coding: utf-8 -*-
"""
apns-server-http2.py
~~~~~~~~~~~~~~~~~
A simple Python script to mock the Apple push notification gateway (requires Python 3.5).
Usage:
$ python3.5 apns-server-http2.py /path/to/certificate.pem /path/to/key.pem certificate_password port
package com.judepereira.jetty.apns.http2;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.StringContentProvider;
import org.eclipse.jetty.http2.client.HTTP2Client;
import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2;
import org.eclipse.jetty.util.ssl.SslContextFactory;
@judepereira
judepereira / a.story
Created October 22, 2018 12:47
hello world!
asd
http server as client
when client listen path: '/github' as request
state = request.query_params['state'] # cli generated
redirect_url = 'https://login.asyncyapp.com/github/oauth_success'
request redirect url: 'https://github.com/login/oauth/authorize' query: {'scope': 'user:email', 'state': state, 'client_id': app.secrets.github_client_id, 'redirect_uri': redirect_url}
# Postback URL for the GH oauth, initiated via the CLI
# The URL should look something like this - https://login.asyncyapp.com/github/oauth_success
when client listen path:'/github/oauth_success' as request
state = request.query_params['state'] # cli generated

Dockerfile:

FROM        python:3.7-alpine

RUN         mkdir /app
ADD         requirements.txt /app
RUN         pip install -r /app/requirements.txt
ADD         app.py /app
diff --git a/src/main.c b/src/main.c
index 8ac1dba..2e43f49 100644
--- a/src/main.c
+++ b/src/main.c
@@ -301,7 +301,7 @@ static uint32_t softdev_init(bool init_softdevice)
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM
};
- APP_ERROR_CHECK( sd_softdevice_enable(&clock_cfg, app_error_fault_handler) );
+ APP_ERROR_CHECK( sd_softdevice_enable(&clock_cfg, app_error_fault_handler, ANT_LICENSE_KEY) );
diff --git a/Makefile b/Makefile
index 6dbaf98..4acd319 100644
--- a/Makefile
+++ b/Makefile
@@ -104,7 +104,7 @@ ifneq ($(IS_52832),)
SD_NAME = s132
DFU_DEV_REV = 0xADAF
else
-SD_NAME = s140
+SD_NAME = s340
$ tree lib/softdevice/s340_nrf52_6.1.1/
lib/softdevice/s340_nrf52_6.1.1/
├── s340_nrf52_6.1.1_API
│   └── include (all header files must be under here)
└── s340_nrf52_6.1.1_softdevice.hex