Skip to content

Instantly share code, notes, and snippets.

Marcos Placona mplacona

Block or report user

Report or block mplacona

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ArduinoBeatingHeart.ino
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <Heart.h>
/*
Android Beating Heart V2- Sketch
Marcos Placona 2019
*/
const int switchPin = 3;
View jetpack-demo-1.2.diff
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
- val myData = DataSource()
- tvMagicNumber.text = myData.getMagicNumber().toString()
+ val model = ViewModelProviders.of(this).get(DataSource::class.java)
+ tvMagicNumber.text = model.getMagicNumber().toString()
}
View jetpack-demo-1.1.diff
package uk.co.placona.jetpackdemo1
- class DataSource {
+ import android.arch.lifecycle.ViewModel
+
+ class DataSource: ViewModel() {
private val tag = MainActivity::class.java.simpleName
private lateinit var myRandomNumber:Number
View jetpack-demo-1.diff
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ def lifecycle_version = "1.1.1"
+ implementation "android.arch.lifecycle:extensions:$lifecycle_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
View jetpack-demo-1.kt
private fun createMagicNumber(){
myRandomNumber = (1..42).shuffled().first()
}
View personal-voicemail.js
exports.handler = function (context, event, callback) {
/***** configuration *****/
const phoneNumber = 'YOUR_PHONE_NUMBER';
const timeout = event.Timeout || 12;
const secureRecordingLinks = false;
const voiceOpts = {
View TwiML.xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message to="YOUR_PHONE_NUMBER">
{{From}}: {{Body}}
</Message>
</Response>
@mplacona
mplacona / Program.cs
Created Feb 21, 2018
Twilio Voice & SMS
View Program.cs
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
namespace Pamphlet
{
internal static class Program
{
private static void Main(string[] args)
@mplacona
mplacona / cleanup.sh
Last active Jul 31, 2017
Cleanup space from node_modules
View cleanup.sh
# cd to your project folder
# How much space is it using?
find . -type d -maxdepth 3 -name node_modules | xargs du -hcs | grep total
# Get rid of them
find . -type d -maxdepth 3 -name node_modules | xargs -p rm -rf # Will prompt before deleting. answer y/n
View SMSController.kt
import com.twilio.twiml.Body
import com.twilio.twiml.Message
import com.twilio.twiml.MessagingResponse
// ...
@RequestMapping(value = "/replyMessage", produces = arrayOf("text/xml"))
fun replyMessage(): String? {
val message = Message.Builder().body(Body("Be getting back to you soon, let me do some more Kotlin first")).build();
return MessagingResponse.Builder().message(message).build().toXml();
}
You can’t perform that action at this time.