Skip to content

Instantly share code, notes, and snippets.

View chrisvasey's full-sized avatar
:shipit:
Working from home

Chris Vasey chrisvasey

:shipit:
Working from home
View GitHub Profile
@Gaelan
Gaelan / README.md
Last active August 29, 2023 04:13
ChatGPT passes the 2022 APCSA free response section

ChatGPT passes the 2022 AP Computer Science A free response section

For fun, I had ChatGPT take the free response section of the 2022 AP Computer Science A exam. (The exam also has a multiple-choice section, but the College Board doesn't publish this.) It scored 32/36.

Methodology

  • For each question, I pasted in the full text of the question and took the response given.
  • I tried each question once and took the response given: no cherry-picking. For readability, I've added indentation in some cases, and included method signatures where they were provided in the question and ChatGPT only provided a body. I've added question numbers; any other comments are ChatGPT's.
  • Many questions have examples containing tables or diagrams; because those don't translate well to plain text, I excluded those tables/diagrams and any text that referenced them.
  • I excluded the initial instructions at the top of th
@nwatab
nwatab / App.js
Last active February 6, 2022 15:42
React Native Hooks (Expo) and Navigation v5 - Splash + Auth + Drawer + Tabs (https://www.youtube.com/watch?v=nQVCkqvU1uE&t)
import React, {useState, useEffect} from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createDrawerNavigator } from "@react-navigation/drawer";
import { Splash, SignIn, CreateAccount, Details, Home, Search, Search2, Profile} from './Screens';
import { AuthContext } from './context';
const AuthStack = createStackNavigator();
@rubenvanassche
rubenvanassche / tests.yml
Last active March 3, 2024 11:12
A simple Laravel testing workflow for GitHub Actions
name: Tests (PHP)
on: [push]
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@chinleung
chinleung / install-laravel-nova-in-subfolder.md
Last active June 22, 2023 19:41
Installing Laravel Nova in subfolder

Instsalling Laravel Nova in a subfolder

This is a guide that will show you how to install Laravel Nova in a subfolder of a domain.

Clone the repository

Clone the repository in the home directory of the cPanel user.

cd /home/user
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@nmfzone
nmfzone / MessagesTranslationServiceProvider.php
Last active March 18, 2023 17:25
Laravel language files on custom directory
// Create MessagesTranslationServiceProvider
// example in : app/Providers/MessagesTranslationServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Services\MessagesTranslator;
@wosephjeber
wosephjeber / ngrok-installation.md
Last active June 4, 2024 07:48
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above: