Skip to content

Instantly share code, notes, and snippets.

View oluwaseye's full-sized avatar
💭
I may be slow to respond.

Oluwaseye oluwaseye

💭
I may be slow to respond.
View GitHub Profile
743511523
@oluwaseye
oluwaseye / receive.js
Created October 21, 2022 19:30
Telynx Inbound SMS/MMS
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.json());
app.post('/webhook', (req, res) => {
const data = req.body.data.payload
console.log(`Start New message `);
console.log(data)
// console.log(data.from)
@oluwaseye
oluwaseye / supabase_db_functions_cheatsheet.sql
Last active August 11, 2022 22:56
Supabase Postgres Functions Cheatsheet
/*Create db function to query a table or relational query*/
CREATE OR REPLACE FUNCTION public.handle_get_user_info()
RETURNS TABLE(email text, fullname text) as $$
BEGIN RETURN QUERY
SELECT
profiles.email,
profiles.fullname
FROM public.profiles WHERE profiles.id = auth.uid()
LIMIT 1;
END;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
@oluwaseye
oluwaseye / contract-f6c467adf0.sol
Created July 8, 2021 19:53
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol";
contract VolaToken is ERC20PresetFixedSupply {
constructor() ERC20PresetFixedSupply("Vola", "VOLA", 1000000000 * 10 ** decimals(), msg.sender) {
}
@oluwaseye
oluwaseye / AppServiceProvider.php
Created February 26, 2021 17:54 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@oluwaseye
oluwaseye / Flutter google signin
Created May 5, 2020 13:20
Updates for Firebase Google signin
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:rxdart/rxdart.dart';
class AuthService {
final GoogleSignIn _googleSignIn = GoogleSignIn();
final FirebaseAuth _auth = FirebaseAuth.instance;
final Firestore _db = Firestore.instance;

Generic

Shortcut Expanded Description Flutter Docs
alertDialog Alert Dialog Creates a showDialog that returns with AlertDialog View Docs
animatedBldr Animated Builder Creates an Animated Builder. The child widget is passed to the builder View Docs
aspectRatio AspectRatio Creates an AspectRatio View Docs
build Build Method Describes the part of the user interface represented by the widget.
column Column Creates a Column Widget View Docs
container Container Creates a Container Widget View Docs
customClipper Custom Clipper Used for creating custom shapes [View Docs](https://api.flutter.
@oluwaseye
oluwaseye / stringExtract.php
Created July 29, 2019 18:37
Extract string from markup
function tagExtractString($string, $start, $end) {
$string = " ".$string;
$init = strpos($string, $start);
if ($ini == 0) return "";
$init += strlen($start);
$len = strpos($string, $end, $init) - $init;
return substr($string, $init, $len);
}
@oluwaseye
oluwaseye / oneliners.js
Created April 1, 2019 19:33 — forked from EmmanuelBeziat/oneliners.js
👑 Awesome one-liners you might find useful while coding.
const headings = [ ... document.querySelectorAll('h1') ]
[{id: 1}, {id: 2}].map(x => x.id)
// [1,2]
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.