Skip to content

Instantly share code, notes, and snippets.

View anshumanv's full-sized avatar
🌊
水の呼吸十一の型

Anshuman Verma anshumanv

🌊
水の呼吸十一の型
View GitHub Profile
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
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;
@zhangludi
zhangludi / 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 May 5, 2024 15:14
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 February 12, 2024 17:18
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 May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ZeeDev
ZeeDev / .editorconfig
Created January 14, 2014 16:28
.editorconfig
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
indent_style = space
end_of_line = lf
charset = utf-8