- Create Directory for your app
mkdir my-app
- get the sapper template
npx degit "sveltejs/sapper-template#rollup"
- Install the packages
npm i
- Install express server
npm i express
- Initialize Firebase
firebase init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ussd.fsm-utils | |
(:require | |
[clojure.string :as str] | |
[clojure.edn :as edn] | |
[ussd.sms :as sms])) | |
(defn check-via | |
[via] | |
(let [choices (:choices (edn/read-string (slurp "../../ussd_fsm.edn")))] | |
(if (contains? choices via) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns api-server.file-io | |
(:use [clojure.tools.logging :only (info warn error)]) | |
(:import (java.nio.channels CompletionHandler AsynchronousFileChannel) | |
(java.nio ByteBuffer) | |
(java.nio.file.attribute FileAttribute) | |
(java.nio.file StandardOpenOption) | |
(java.util.concurrent Executors)) | |
(:require [clojure.core.async :as async :refer [chan go put! close!]] | |
[clojure.java.io :as io])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:bloc/bloc.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn component [] | |
(js/Reflect.construct js/HTMLElement #js [] component)) | |
(set! (.-prototype component) | |
(js/Object.create (.-prototype js/HTMLElement) | |
#js {:connectedCallback | |
#js {:configurable true | |
:value | |
(fn [] | |
(this-as this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/services.dart'; | |
import 'package:intl/intl.dart'; | |
class CurrencyPtBrInputFormatter extends TextInputFormatter { | |
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { | |
if(newValue.selection.baseOffset == 0){ | |
return newValue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request.onupgradeneeded = function(event) { | |
var db = event.target.result; | |
var upgradeTransaction = event.target.transaction; | |
var objectStore; | |
if (!db.objectStoreNames.contains("my-store")) { | |
objectStore = db.createObjectStore("my-store"); | |
} else { | |
objectStore = upgradeTransaction.objectStore('my-store'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Code Below is used to develop a Diamond Pattern. | |
1. Start with Identifying the First Diamond | |
2. Put in the coordinates for the First Diamind | |
3. Create a for-loop to to create diamonds at the same time | |
4. Introduce an outer for-loop to cater for the y - axis. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS users; | |
DROP VIEW IF EXISTS bp; | |
CREATE TABLE users (name, cn, title, manager); | |
CREATE VIEW bp AS | |
-- create a CTE (common table expression) | |
-- think of this as creating a temporary table that only exists during this query | |
-- works somewhat like CREATE TEMPORARY TABLE bosspath(cn, path) | |
WITH RECURSIVE bosspath(cn,path) AS | |
( |