Skip to content

Instantly share code, notes, and snippets.

View chroline's full-sized avatar
🤩

Cole Gawin chroline

🤩
View GitHub Profile
@chroline
chroline / instagram-follower-following.js
Created March 11, 2024 05:59 — forked from abir-taheer/instagram-follower-following.js
"This is our community, this is our family, these are our friends." https://www.youtube.com/watch?v=gk7iWgCk14U&t=425s
if (window.location.origin !== "https://www.instagram.com") {
window.alert(
"Hey! You need to be on the instagram site before you run the code. I'm taking you there now but you're going to have to run the code into the console again.",
);
window.location.href = "https://www.instagram.com";
console.clear();
}
const fetchOptions = {
credentials: "include",
@chroline
chroline / commands.bash
Created March 6, 2022 18:01
EAS commands
# Installing Expo & EAS CLIs
npm install --global expo-cli
npm install --global eas-cli
# Run app in Expo Go
expo start
# Enable EAS in project
eas build:configure
@chroline
chroline / runner.ts
Last active December 5, 2021 22:04
DIY file watcher with Parcel
// make sure you have @parcel/core and @parcel/config-default
// installed as devDependencies
import {Parcel} from '@parcel/core';
import {spawn, ChildProcessWithoutNullStreams} from 'child_process';
let bundler = new Parcel({
entries: 'src/index.ts',
defaultConfig: '@parcel/config-default',
defaultTargetOptions: { distDir: `${process.cwd()}/dist` },
@chroline
chroline / firebase-service.ts
Last active August 29, 2021 00:30
LIGHTNING SHARE Firebase service
import { BehaviorSubject } from "rxjs";
namespace FirebaseService {
let _app: import("@firebase/app").FirebaseApp;
export const userId$ = new BehaviorSubject<string | undefined>(undefined);
/**
* Initialize Firebase.
*/
@chroline
chroline / file-service.ts
Created August 28, 2021 23:59
LIGHTNING SHARE file service
import { FileInfo } from "../util/file-info";
namespace FileService {
/**
* Upload file.
*
* @param {File} file - file to be uploaded
* @returns {string} generated word code for file
*/
export async function upload(file: File): Promise<string> {
@chroline
chroline / .prettierrc.json
Created August 2, 2021 17:33
Prettier configuration for my projects
{
"arrowParens": "avoid",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "always",
@chroline
chroline / theme.ts
Created August 2, 2021 16:50
Chakra UI theme for my projects
import { createBreakpoints } from "@chakra-ui/theme-tools";
const fonts = {
body: `'Inter', sans-serif`,
heading: `'Inter', sans-serif`,
mono: `'Menlo', monospace`,
};
const breakpoints = createBreakpoints({
sm: "640px",
@chroline
chroline / near_miss.dart
Last active April 26, 2021 03:01
Near Miss Game for Flutter
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(NearMissApp());
class NearMissApp extends StatelessWidget {
@override
### test slug API route
GET <http://localhost:3000/api/the> $pluralNoun is $gerund
### test request body API route
POST <http://localhost:3000/api/>
Content-Type: application/json
{
"query": "the $pluralNoun is $gerund"
}
import { NextApiRequest, NextApiResponse } from "next";
export default async (req: NextApiRequest, res: NextApiResponse) => {
const { query } = req.body as { query: string };
res.send(slug);
}