This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| As a senior software engineer with over | |
| 10 years of experience and deep expertise in automated unit testing with TypeScript, | |
| Next.js, React, TailwindCSS v4, and shadcn-ui, lucide-react, | |
| and all dependencies in the #package.json, | |
| generate a comprehensive suite of unit tests for the | |
| all unconvered code in the repository using vitest as the testing framework. Ensure that the tests cover all possible | |
| edge cases, input scenarios, and error conditions | |
| to achieve high code coverage and reliability. Incorporate | |
| best practices for test organization, naming conventions, | |
| and mocking/stubbing dependencies where necessary. Additionally, provide explanations for the testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # Iterate over files in the directory | |
| for filename in *; do | |
| # Check if the filename is a regular file | |
| if [[ -f "$filename" ]]; then | |
| # Extract filename and extension | |
| base_filename=$(basename "$filename") | |
| extension="${base_filename##*.}" | |
| base_filename="${base_filename%.*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path') | |
| const webpack = require('webpack') | |
| const HtmlWebpackPlugin = require('html-webpack-plugin') | |
| // add | |
| const Dashboard = require('webpack-dashboard'); | |
| const DashboardPlugin = require('webpack-dashboard/plugin'); | |
| const dashboard = new Dashboard(); | |
| // add |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| export HOMEBREW_CASK_OPTS="--appdir=/Applications" | |
| echo Install Homebrew, Postgres, wget and cask | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| brew tap homebrew/dupes | |
| brew install wget | |
| brew install postgresql | |
| brew install mongodb | |
| brew install mongoose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Always sort the files | |
| --sort-files | |
| # Always color, even if piping to a another program | |
| --color | |
| # Use "less -r" as my pager | |
| --pager=less -r | |
| # File type search options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mongoid.connect_to 'mongoid-3144' | |
| class Post | |
| include Mongoid::Document | |
| field :name | |
| embeds_many :comments | |
| accepts_nested_attributes_for :comments | |
| # This line somehow triggers the bug; commenting it out fixes the bug, wierd. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: UTF-8 | |
| Pry.config.editor = "vim" | |
| Pry.config.pager = false | |
| Pry.config.commands.alias_command "lM", "ls -M" | |
| if defined?(Encoding) then | |
| Encoding.default_external = 'utf-8' | |
| Encoding.default_internal = 'utf-8' | |
| else | |
| $KCODE = 'utf-8' |
NewerOlder