Skip to content

Instantly share code, notes, and snippets.

View anshumanv's full-sized avatar
🌊

Anshuman anshumanv

🌊
View GitHub Profile
@nandorojo
nandorojo / knew.md
Last active August 12, 2025 05:38
What I wish I knew when I started with Expo Web, React Navigation & Next.js

I started using React Native in September 2018. I always forget some things when I build new apps, so I'll keep track of the gotchas on this post.

Some topics, such as navigation, will be fundamental to how I think about apps. Others, will be one-line helpers that make apps work more smoothly.

It's gotten to the point where I find my own answers from 6 months before on certain Github issues.

I'll keep adding over time as I think of more. If anyone thinks these topics would be useful, let me know and I'll elaborate.

I have made libraries to address a number of the topics here, from navigation to design.

@lhorie
lhorie / longest-keyword-sequence.md
Last active November 13, 2024 04:15
What's the longest keyword sequence in Javascript?
@Hsankesara
Hsankesara / checkRegularGrammer.c
Last active November 14, 2018 06:37
Automata Theory codes.
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
typedef struct Translation Translation;
typedef struct State State;
typedef struct Translation
{
struct State *nextState;
char input;
@didinew
didinew / How to save username and password in git
Last active August 15, 2018 09:52
git 记住账户密码
https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%87%AD%E8%AF%81%E5%AD%98%E5%82%A8
git 凭证存储
1.
git config credential.helper store
2. git pull

Linux Tricks

  • Use cd $_ to get into previous arguement Eg:
mkdir folder-name && cd $_
@quietjoy
quietjoy / wifi-remember.ps1
Last active February 11, 2023 15:20
Get wifi networks and passwords
# The following is a powershell script to get all previously joined wifi networks and passwords for windows systems
# The number of lines skipped in the following command may need to be altered if "Group policy profiles" are available
$profiles = $(netsh wlan show profiles) -split "\n" | Select-Object -Skip 9 | Select -SkipLast 1
foreach($profile in $profiles)
{
$network = $profile.Split(":")[1].Replace(" ", "")
$info = $(netsh wlan show profile $network key=clear)
$key = $info | Select-String -Pattern "Key Content"
@gaearon
gaearon / slim-redux.js
Last active August 7, 2025 09:46
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@gaearon
gaearon / reduce-store-time-travel.js
Last active January 30, 2024 05:08
Time travelling concept with reducey stores and state atoms inspired by https://gist.github.com/threepointone/43f16389fd96561a8b0b#comment-1447275
/**
* Stores are just seed + reduce function.
* Notice they are plain objects and don't own the state.
*/
const countUpStore = {
seed: {
counter: 0
},
reduce(state, action) {
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 8, 2025 15:03
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active August 22, 2025 19:23
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k