Skip to content

Instantly share code, notes, and snippets.

View itzsaga's full-sized avatar
🍕

Seth itzsaga

🍕
View GitHub Profile
@elierotenberg
elierotenberg / BLOG.md
Last active August 16, 2023 12:01
Idiomatic Data Fetching using React Hooks

Idiomatic Data Fetching using React Hooks

This post has been written in collaboration with @klervicn

Virtually all web apps and websites need to pull data from a server, usually through a JSON-returning API. When it comes to integrating data fetching in React component, the "impedence mismatch" between the React components, which are declarative and synchronous, and the HTTP requests, which are imperative and asynchronous, is often problematic.

Many apps use third-party libraries such as Redux or Apollo Client to abstract it away. This requires extra dependencies, and couple your app with a specific library to perform data fetching. In most cases, what we want is a direct way to integrate plain HTTP requests (e.g. using native fetch) for usage in React components.

Here we will discuss how we can use React Hooks to do this in an elegant, scalable manner.

@jasny
jasny / sha256-hmac.md
Last active December 12, 2023 12:32
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@amhinson
amhinson / usage.js
Last active December 14, 2018 17:35
Yup - valid image url/source
yup.object().shape({
imageUrl: yup
.string()
.test('valid-image-url', 'Must use valid image URL', value =>
testImage(value, 1000).then(status => status === 'success')
)
})
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
anonymous
anonymous / Why teach ruby.md
Created August 11, 2017 20:56

As the Co-Founder and Dean of Flatiron School I thought it important to write a response to the recent implication that because a school switched their curriculum focus from Ruby to Java that means the Ruby and Ruby on Rails Job Market is Waning or the popularity and importance of Ruby and Ruby on Rails is diminishing.

During my career as a programmer I have worked primarily in ASP, Javascript, PHP, C#, and Ruby with a sprinkling of many other languages including Java. As a teacher, I've taught Web Development with Ruby on Rails and Javascript for over 5 years and helped thousands of students begin their careers in code.

At Flatiron School we are obsessed with the employment outcomes of our students. For 4 years we've taken it upon ourselves to publish an independently audited and verified Jobs Report detailing how our graduates perform in the job market. We're proud that for 4 years with over a thousand graduates we've maintained a 97% and above employment rate in technical roles.

The truth is that the l

kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@lucko
lucko / auto-sign-commits-mac.md
Last active April 15, 2024 08:26
Auto-sign commits with IntelliJ on MacOS

Run:

  • brew install gnupg pinentry-mac
  • git config --global user.signingkey <key>
  • git config --global commit.gpgsign true
  • git config --global gpg.program gpg

Then add the following line to ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac
@nurrony
nurrony / configuration.md
Last active July 10, 2020 15:39
Auto git push script to post Ghost blog to Github Pages

Assumption

I am asumming that you have following this already taken care in your dev machine

  1. Fully configured up and running [Ghost][1] blog
  2. Successfully installed [Buster][2] Script
  3. Already have Git Page for your account

Instructions

@bmcbride
bmcbride / google-form-to-github-issue.md
Last active April 5, 2024 15:47
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION