Skip to content

Instantly share code, notes, and snippets.

View sudarshang's full-sized avatar

Sudarshan Gaikaiwari sudarshang

View GitHub Profile
@lihaoyi
lihaoyi / gist:1ebdd89b065a741a1ea72b5d780b9ab1
Last active January 2, 2017 20:01
Setting up a "Walk through pre-loaded example snippets every time you press spacebar" experience in the Ammonite REPL
lihaoyi Ammonite$ amm
Loading...
Welcome to the Ammonite Repl 0.8.0
(Scala 2.11.8 Java 1.8.0_112)
@ {
val funnyFilter = ammonite.terminal.Filter.simple(" ")((b, c, m) =>
if (FunnyFrontEnd.nextLine == Nil) (b.take(c) ++ " " ++ b.drop(c), c+1)
else {
val head :: tail = FunnyFrontEnd.nextLine
FunnyFrontEnd.nextReader = new java.io.StringReader(head)
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name

React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app
@adrianhall
adrianhall / AppSync-Example.yaml
Created April 13, 2018 16:01
An example CloudFormation template for AWS AppSync
---
Description: AWSAppSync DynamoDB Example
Resources:
GraphQLApi:
Type: "AWS::AppSync::GraphQLApi"
Properties:
Name: AWSAppSync DynamoDB Example
AuthenticationType: AWS_IAM
PostDynamoDBTableDataSource:
@stephenfjohnson
stephenfjohnson / makerLink.js
Created April 16, 2018 16:08
Maker Link with React Styled Components

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
#!/usr/bin/env python3
"Generate all strings containing just ( and ) with parens balenced."
from itertools import count
def parens():
def nested(x):
return ("(" * x) + (")" * x) if x > 0 else ""
@threepointone
threepointone / settled.react.md
Last active August 4, 2020 19:09
Ember's settled() test helper, for React

settled

Stealing an idea from ember's settled test helper.

Assuming these conditions are true in your unit tests -

  • you're using Jest
  • and Jest's fake timers
  • and all your data requests are happening via fetch
@markerikson
markerikson / reactiflux-chat-react-hooks-storage.md
Created September 14, 2019 00:31
Reactiflux chat log: How does React store hooks on Fibers?

[12:14 AM] acreddy : are hooks value stored in fiber?

[10:40 AM] ghardin137 : not really

[10:50 AM] acemarke : @acreddy, @ghardin137 : yes they are, actually.

A "fiber" is a plain JS object that React uses to store bookkeeping information on each rendered component in the tree. The linked list of hooks is indeed stored as a field on the fiber for that component