Skip to content

Instantly share code, notes, and snippets.

View louis-lemon's full-sized avatar

Louis louis-lemon

  • LemonCloud Co.,Ltd.
  • Seoul, Korea
View GitHub Profile
@ijlee2
ijlee2 / ci-cd.yml
Last active August 29, 2023 21:37
GitHub Actions workflow for Ember apps (yarn)
# The workflow template is designed for Ember apps.
#
# It assumes certain dependencies and scripts in package.json. If
# they don't apply to your project, feel free to remove irrelevant
# code in the workflow. These can be inferred from the job name.
#
# {
# "scripts": {
# "build": "ember build --environment=production",
# "build:test": "ember build --environment=test",
@wesleygrimes
wesleygrimes / upgrading-to-angular-ngrx-8.md
Created June 12, 2019 19:17
Upgrading to Angular v8 and NgRx v8

Upgrading to Angular 8 and NgRx 8

Overview

Do you have an awesome application written with Angular v7 using NgRx v7, but have been feeling left out will all the mentions online and at conferences about Angular v8 and NgRx v8? Well you are in luck! Today we will explore together, how to upgrade our applications to use Angular v8 using the Angular CLI tooling. We will also explore upgrading to NgRx v8. This will allow us to take advantage of the new features provided in NgRx v8. Included with NgRx v8 is a shiny set of creators, or type-safe factory functions, for actions, effects, and reducers.

Upgrading Dependencies

Upgrading Angular

The Angular team has provided a great website that walks through the process of upgrading in-depth. This website can be found at Angular Update Tool. We will touch on some of the information today.

@kolosovsky
kolosovsky / aabb.md
Last active February 3, 2024 14:16
The computation of the axis-aligned bounding box (AABB) in JavaScript

The computation of the axis-aligned bounding box (AABB) in JavaScript

Polygon (rectangle, triangle, etc.)

Live demo https://jsfiddle.net/Kolosovsky/tdqv6pk2/

let points = [
	{ x: 125, y: 50 },
	{ x: 250, y: 65 },
@johngrimes
johngrimes / formatStagedFiles.sh
Created February 14, 2018 22:15
Format staged files with Prettier before commit
#!/bin/bash
STAGED=$(git diff --name-only --cached --diff-filter=AM | egrep '^(.*).(js|json|css)$')
yarn prettier --write $STAGED
git add $STAGED
@robpataki
robpataki / _easing-functions.scss
Last active August 10, 2022 18:51
Easing functions to be used in SCSS
// Easing function variables - http://easings.net/#easeOutQuint
// SINE
$ease-in-sine: cubic-bezier(0.47, 0, 0.745, 0.715);
$ease-out-sine: cubic-bezier(0.39, 0.575, 0.565, 1);
$ease-in-out-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
// QUAD
$ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
@Tuizi
Tuizi / test-helper.spec.ts
Last active March 19, 2021 19:47
MockStore for Angular ngrx/store unit tests
import { Action, ActionReducer, Store } from '@ngrx/store';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { map } from 'rxjs/operator/map';
import { Observer } from 'rxjs/Observer';
// TODO: How to initialize those variables?
const dispatcherMock: Observer<Action>,
reducerMock: Observer<ActionReducer<any>>,
stateMock: Observable<any>;
@lobster1234
lobster1234 / localstack.md
Last active August 8, 2023 20:06
Working with localstack on command line

Starting localstack

C02STG51GTFM:localstack mpandit$ make infra
. .venv/bin/activate; exec localstack/mock/infra.py
Starting local dev environment. CTRL-C to quit.
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 server (port 4572)...
Starting mock SNS server (port 4575)...
@greatb
greatb / cookie.service.ts
Last active April 14, 2023 17:17
Injectable CookieService class for Angular2
@markcerqueira
markcerqueira / WKWebViewCookie.m
Last active May 15, 2020 06:20
Getting cookies into a WKWebView
// API reference: https://developer.apple.com/reference/webkit/webpolicydelegate/1536273-webview?language=objc
// Adapted from the Swift implementation: http://stackoverflow.com/a/32196541
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
if (![self requiresCookie:navigationAction]) {
decisionHandler(WKNavigationActionPolicyAllow);
return;
}
@kndt84
kndt84 / authorize.js
Last active April 10, 2024 15:15
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;