Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| addEventListener('fetch', event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| const url = new URL(request.url) | |
| // Check if the path starts with /blog | |
| if (url.pathname.startsWith('/blog')) { | |
| const subPath = url.pathname.replace('/blog', '') | |
| const githubUrl = new URL(`SOURCE_URL${subPath}`) |
| import { AirtopClient } from "@airtop/sdk"; | |
| import puppeteer from "puppeteer-core"; | |
| const apiKey = "YOUR_AIRTOP_API_KEY"; | |
| const client = new AirtopClient({ apiKey }); | |
| // Step 1: Create a session | |
| const session = await client.sessions.create(); | |
| // Step 2: Connect to the browser |
| // Declare the queue name | |
| string QueueName = "QTransactions"; | |
| // Create a new connection factory for the queue | |
| var factory = new ConnectionFactory(); | |
| // Because Rabbit is installed locally, we can run it on localhost | |
| factory.HostName = "127.0.0.1"; | |
| using (var connection = factory.CreateConnection()) | |
| using (var channel = connection.CreateModel()) | |
| { |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| ########## Variables | |
| dir=~/dotfiles # dotfiles directory | |
| olddir=~/dotfiles_old # old dotfiles backup directory | |
| files=".bashrc .vimrc .vim" # list of files/folders to symlink in homedir | |
| ########## | |
| # create dotfiles_old in homedir | |
| echo "Creating $olddir for backup of any existing dotfiles in ~" |
| #include <avr/sleep.h> | |
| #include <avr/interrupt.h> | |
| #include <Heart.h> | |
| /* | |
| Android Beating Heart V2- Sketch | |
| Marcos Placona 2019 | |
| */ | |
| const int switchPin = 3; |
| <cfscript> | |
| QueueName = "QTransactions"; | |
| durable = true; | |
| loadPaths = arrayNew(1); | |
| loadPaths[1] = expandPath("lib/rabbitmq-java-client-bin-2.8.4/rabbitmq-client.jar"); | |
| // load jars | |
| javaLoader = createObject("component", "lib.javaloader.JavaLoader").init(loadPaths); |
| #include <Bounce2.h> | |
| #define BUTTON_PIN PB4 | |
| #define led1Pin PB0 | |
| #define led2Pin PB1 | |
| #define led3Pin PB2 | |
| #define led4Pin PB3 | |
| #define switchPin PB4 | |
| #define delayInterval 100 | |
| Bounce debouncer = Bounce(); // Instantiate a Bounce object |
| 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() | |
| } |
| 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 |