Skip to content

Instantly share code, notes, and snippets.

View AndyOsei's full-sized avatar

AndyOsei AndyOsei

  • Ghana
View GitHub Profile
@AndyOsei
AndyOsei / oauth_token_route.ts
Last active February 19, 2024 23:01
/token route handler for oauth2.0 token in nestjs
@Post('token')
@UseGuards(BasicAuthGuard)
async token(
@Req() req: Request,
@Res() res: Response,
@Next() next: NextFunction,
) {
const server = this.oauthService.getOAuthServer();
const tokenMiddleware = server.token();
@AndyOsei
AndyOsei / flutter_github_ci.yml
Created April 8, 2021 09:59 — forked from rodydavis/flutter_github_ci.yml
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@AndyOsei
AndyOsei / tween_and_curve_simulator.dart
Created March 4, 2021 11:58 — forked from funwithflutter/tween_and_curve_simulator.dart
Flutter example to demonstrate the chaining of Tweens and Cuves, plus creating your own Curves and Tweens classes.
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@AndyOsei
AndyOsei / custom_bottom_nav_bar_anim.dart
Last active March 4, 2021 19:08
Custom bottom navigation bar animation
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@AndyOsei
AndyOsei / scrape_with_browser_console.js
Last active March 4, 2021 19:09
Webpage scraping script
console.API;
if (typeof console._commandLineAPI !== 'undefined') {
console.API = console._commandLineAPI; //chrome
} else if (typeof console._inspectorCommandLineAPI !== 'undefined') {
console.API = console._inspectorCommandLineAPI; //Safari
} else if (typeof console.clear !== 'undefined') {
console.API = console;
}
console.save = function(data, filename) {
@AndyOsei
AndyOsei / eslint_prettier_airbnb.md
Created November 30, 2020 01:11 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
FROM alpine:latest
RUN apk add --update php python py-pip mysql-client \
&& pip install awscli \
&& rm -rf /var/cache/apk/*
RUN touch crontab.tmp \
&& echo '* */6 * * * echo "working..."' > crontab.tmp \
&& echo '0 2 * * * echo "working again...' >> crontab.tmp \
&& crontab crontab.tmp \
image: golang:1.12.6
variables:
REPO: gitlab.com
GROUP: flying_kiwi
PROJECT: go-ci-demo
stages:
- test
run apk --no-cache add --virtual native-deps \
g++ gcc libgcc libstdc++ linux-headers make python && \
npm install --quiet node-gyp -g &&\
npm install --quiet && \
apk del native-deps
const workbook = XLSX.readFile(filename);
const sheet_name_list = workbook.SheetNames;
let jsonPagesArray = [];
sheet_name_list.forEach(function(sheet) {
const jsonPage = {
name: sheet,
content: XLSX.utils.sheet_to_json(workbook.Sheets[sheet], {defval: ""})
};
jsonPagesArray.push(jsonPage);
});