Skip to content

Instantly share code, notes, and snippets.

@yungwarlock
yungwarlock / sqlite3.bash
Created November 12, 2023 02:26
How to use sqlite3 cli
#!/bin/bash
# Connect to database
sqlite db.sqlite
# Get all tables names
.table
# Get all tables and their information
select * from sqlite_master;
@yungwarlock
yungwarlock / yarn.bash
Last active November 11, 2023 12:21
Yarn workspaces setup
#!/usr/bin/env bash
yarn set version stable
yarn config set nodeLinker node-modules
@yungwarlock
yungwarlock / gist:e91bbf73b8f6d48523d2bc0f1c2cc287
Created October 25, 2023 08:42
How to renable android 12 internet button
#!/bin/sh
settings put global settings_provider_model false
settings put secure sysui_qs_tiles "internet,$(settings get secure sysui_qs_tiles)"
@yungwarlock
yungwarlock / mobile.yaml
Created October 15, 2023 16:54
Simple Github action to build flutter project
name: Mobile
on:
workflow_dispatch:
push:
branches: [master]
permissions:
contents: read
pull-requests: read
@yungwarlock
yungwarlock / globals.css
Last active September 30, 2023 15:18
Tailwind hidescrollbar
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
@layer components {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
@yungwarlock
yungwarlock / main.dart
Last active September 4, 2023 13:26
SchedulerBinding
import 'package:flutter/material.dart';
import "package:flutter/scheduler.dart";
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
/* item.subtitle != null */
/* ? Container( */
/* padding: const EdgeInsets.symmetric( */
/* vertical: 4, */
/* horizontal: 8, */
/* ), */
/* color: Colors.grey[100], */
/* child: Row( */
/* children: [ */
/* CircleAvatar( */
@yungwarlock
yungwarlock / main.js
Created August 21, 2023 13:51
Uploading a file using file stream to firebase storage
// async function uploadCourseThumbnail(path: string) {
// const fileID = createID();
// const file = storage.file(`${fileID}.png`);
// file.makePublic();
// return new Promise((resolve, reject) => {
// const publicUrl = file.publicUrl();
async function uploadCourseThumbnail(path: string) {
const fileID = createID();
const file = storage.file(`${fileID}.png`);
file.makePublic();
return new Promise((resolve, reject) => {
const publicUrl = file.publicUrl();
fs.createReadStream(path)
@yungwarlock
yungwarlock / nearest_neighbor.ipynb
Created July 2, 2023 01:09
nearest_neighbor.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.