Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮
GameDev by night

Ajinkya Borade steelx

🎮
GameDev by night
View GitHub Profile
@LukeMathWalker
LukeMathWalker / audit-on-push.yml
Last active Aug 15, 2022
GitHub Actions - Rust setup
View audit-on-push.yml
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
@rounakdatta
rounakdatta / esp32_ota_stm32.ino
Created Sep 6, 2019
Flash STM32 firmware from ESP32
View esp32_ota_stm32.ino
#include <SPIFFS.h>
/*
*
* Copyright (C) 2017 CS.NOL https://github.com/csnol/1CHIP-Programmers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* and You have to keep below webserver code
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active Aug 17, 2022
Helpful shortcuts for VSCode
View vscode_shortcuts.md

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@irfn
irfn / alacrity.yml
Last active Jun 16, 2022
alacrity config
View alacrity.yml
env:
TERM: xterm-256color
window:
dimensions:
columns: 80
lines: 24
padding:
x: 2
@mauricedb
mauricedb / Subject under test
Last active Jul 15, 2022
Testing stateful React hooks
View Subject under test
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}
@hubgit
hubgit / SelectField.tsx
Last active Aug 9, 2022
Use react-select with Formik
View SelectField.tsx
import { FieldProps } from 'formik'
import React from 'react'
import Select, { Option, ReactSelectProps } from 'react-select'
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({
options,
field,
form,
}) => (
<Select
@rishikeshdhokare
rishikeshdhokare / git_refresh
Last active Jun 5, 2018
git pull all the repositories in a directory
View git_refresh
#!/bin/bash
for d in ./*/;
do (
cd "$d" &&
currentDir=`pwd`
echo "updating `basename "$currentDir"`..."
git pull
);
done
View Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS).markdown

#Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS)

  1. Formatt the Micro SD card - Open a terminal and type 'diskutil list'. Find your card and copy the disk name (For example: /dev/disk4). Format the card with diskutil eraseDisk ExFat temp disk4(Use your disk here)
  2. Download Raspbian - wget https://downloads.raspberrypi.org/raspbian_lite_latest
  3. Unmount the SD card - diskutil unmountDisk /dev/disk4 or whatever your disk path is
  4. Mount the Raspbian image to the card - sudo dd if=PATH-TO-RASPBIAN-IMAGE of=/dev/disk4` or whatever your disk path is
  5. Enable SSH on the Pi - cd /volumes && ls. You should see a boot partition from the SD card cd boot && touch ssh
  6. Setup WiFi on the PI - While still in the boot partition of the card type nano wpa_supplicant.conf and enter network={ ssid="YOUR-SSID" psk="YOUR-WIFI-PASSWORD" }
  7. Boot the PI - Unmount the card diskutil unmountDisk /dev/disk4 (or whatever your disk path is) and put it in the
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active Jul 12, 2022
Difference between Shallow, Mount and render of Enzyme
View enzyme_render_diffs.md

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@ardinusawan
ardinusawan / TOTP.java
Created Dec 4, 2016
RFC 6238 OTP - 10 digits (Modified from https://tools.ietf.org/html/rfc6238)
View TOTP.java
import java.lang.reflect.UndeclaredThrowableException;
import java.security.GeneralSecurityException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.math.BigInteger;
import java.util.TimeZone;