Skip to content

Instantly share code, notes, and snippets.

View svngoku's full-sized avatar
🦩
Your favorite Teachlead 🥸

svngoku

🦩
Your favorite Teachlead 🥸
View GitHub Profile
@svngoku
svngoku / fetch-api-examples.md
Created February 4, 2019 12:15 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples

Algorithmic layouts

You are looking at the most important, and most abundant thing on the web. You can't see it, unfortunately, because it's very small… aaaaand it's invisible — so having a magnifying glass doesn't really help here. But still.

I'm talking, of course, about U+0020; not to be confused with the band U2, who are just as ubiquitous, but far less useful.

This unicode point, representing the humble space character, is between every word, in every run of text, on every page of the web. And it has a very special characteristic: it's not sticky like glue. If two words are neighbors but there's not enough room for both of them, the space will free the second word to wrap around and start a new line.

Before getting into flexible containers, viewport meta tags, and @media breakpoints this humble character is what makes the web fundamentally 'responsive'. That is: able to change the layout of its content to suit different devices, contexts, and settings. Browser text does this automa

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@svngoku
svngoku / mysql_cheat_sheet.md
Last active January 12, 2024 13:42 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@Component({
templateUrl: './login-page.component.html'
})
export class LoginPageComponent {
loginForm = new FormGroup({
email: new FormControl('', Validators.required),
password: new FormControl('', Validators.required)
});
error: string | null = null;
@svngoku
svngoku / gist:bac8c65a250ab4ae9bebe434dd7579d1
Last active June 24, 2019 23:03 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@svngoku
svngoku / github_api_example.py
Created July 25, 2019 13:15 — forked from mxmader/github_api_example.py
Simple GitHub API example using python and personal access token
import requests
import json
####
# inputs
####
username = ''
# from https://github.com/user/settings/tokens
token = ''
@svngoku
svngoku / ts-jest.md
Created January 8, 2020 07:39 — forked from jackawatts/ts-jest.md
Getting started with Typescript, React and Jest

Getting Started

  1. Install:
  • jest: npm install --save-dev jest
  • ts-jest: npm install --save-dev ts-jest @types/jest
  1. Modify package.json
    "transform": {
      "^.+\\.tsx?$": "ts-jest"
    },
@svngoku
svngoku / Movie-test.js
Created January 8, 2020 07:39 — forked from nzaghini/Movie-test.js
Apollo GraphQL Test Example with Jest
import fs from 'fs'
import { makeExecutableSchema } from 'graphql-tools'
import { graphql } from 'graphql'
// the actual resolvers
import resolvers from '../src/resolvers'
// the mock service
import mockMovieService from './mocks/mockMovieService'
// a nice structure for test cases
// found at https://hackernoon.com/extensive-graphql-testing-57e8760f1c25
@svngoku
svngoku / babel-webpack.md
Created February 16, 2020 01:29 — forked from ncochard/babel-webpack.md
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.