Skip to content

Instantly share code, notes, and snippets.

@heysanil
heysanil / unhide-files.sh
Created March 13, 2024 02:00
Bash script to recursively hide all files in a directory and its subdirectories
#!/bin/bash
# Function to recursively process files and folders
process_directory() {
local directory="$1"
# Loop through each item in the directory
for item in "$directory"/*; do
# Check if the item is a file
if [[ -f "$item" ]]; then
QMA 4 GEM 2007/01/11
IIDX GOLD GLD 2007/02/21
pop'n 15 G15 2007/04/25
Otomedius GGG 2007/11/02
DJ Troopers HDD 2007/12/19
QMA 5 HAL 2008/01/12
pop'n 16 H16 2008/03/24
Horseriders G23 2008/04/09
GFDM V5 H32/H33 2008/06/18
Empress I00 2008/11/19
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active May 4, 2024 12:36
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

Transparent Restaurant Backend

In this task, you're going to implement a REST API for a interacting with a menu of a restaurant. The menu is given to you as a JSON file which you will parse and perform operations on. The required features will be listed below.

Description

In this restaurant, honesty is extremely promoted. So extreme, that the restaurant declares that differing quality of ingredients are used in their meals. Like that's not enough, it also allows the customers to choose the ingredients of each meal in different qualities. Each ingredient has the following quality levels:

  • low: the cheapest
  • medium: moderate
@phatblat
phatblat / AppDelegate.swift
Last active May 4, 2024 12:34
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
let healthKitManager = HealthKitManager()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if onboardingComplete {
healthKitManager.requestAccessWithCompletion() { success, error in
if success { print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error)") }
}
@moskomule
moskomule / tinyimagenet.sh
Created November 6, 2017 10:48
tiny imagenet downloader
#!/bin/bash
# download and unzip dataset
#wget http://cs231n.stanford.edu/tiny-imagenet-200.zip
unzip tiny-imagenet-200.zip
current="$(pwd)/tiny-imagenet-200"
# training data
cd $current/train
@esemi
esemi / before_offer.md
Last active May 4, 2024 12:32
Вопросы к собеседованию (от лица кандидата)

Вопросы к собеседованию

Не претендую на универсальность. Это только лишь те вещи, которые важны мне. Пояснять зачем нужен каждый вопрос пока в паблик не готов, но можем обсудить за кофе)

Проект

  • что делаем
  • кто пользователи и сколько
  • на какие рынки работаем сейчас
@matthewzring
matthewzring / markdown-text-101.md
Last active May 4, 2024 12:26
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@KacperKozak
KacperKozak / ctrl-enter.js
Last active May 4, 2024 12:24
[Ctrl] + [Enter] to submit forms
document.body.addEventListener('keydown', (event) => {
if(event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
event.target.form?.submit();
}
});