Skip to content

Instantly share code, notes, and snippets.

@timbophillips
timbophillips / gist:caa9a2cfc1ee80d846c72b31b592c7a9
Created January 10, 2018 14:07
install all google web fonts in ubuntu
# Original author: Michalis Georgiou <mechmg93@gmail.comr>
# Modified by Andrew http://www.webupd8.org <andrew@webupd8.org>
_wgeturl="https://github.com/google/fonts/archive/master.tar.gz"
_gf="google-fonts"
# install wget
sudo apt-get install wget
# make sure a file with the same name doesn't already exist
@timbophillips
timbophillips / gist:75b041333cae411e1569f4bd103308d7
Created January 10, 2018 14:09
make ubuntu 17.10 look better
sudo add-apt-repository ppa:snwh/pulp
sudo apt update
sudo apt install gnome-session gnome-tweak-tool arc-theme paper-icon-theme
update-alternatives --set gdm3.css /usr/share/gnome-shell/theme/gnome-shell.css
@timbophillips
timbophillips / local-fonts-icons-angular
Created January 1, 2019 00:44
host roboto font and material icons locally in angular app
//// npm install --save roboto-fontface material-icons
//// put the below stuff into src/styles.scss
// for npm roboto-fontface package (to load local files)
$roboto-font-path: "~roboto-fontface/fonts" !default;
@import "~roboto-fontface/css/roboto/sass/roboto-fontface";
// for npm material-icons package (to load local files)
$material-icons-font-path: '~material-icons/iconfont/';
@timbophillips
timbophillips / angular.json
Last active October 3, 2019 12:58
Fix CORS problem using Angular (Webpack) proxy - this redirects /api to localhost:8888
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "eaglebayng:build",
"proxyConfig": "src/proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "eaglebayng:build:production"
}
@timbophillips
timbophillips / Generate-Github-SSH-key.ps1
Created October 27, 2019 02:38
Adding a new SSH key to your GitHub account - using PowerShell on Windows
Write-Host "
This script performs the steps from
https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
1. generate a ssh key
2. start the ssh-agent service
3. add the key to the agent
4. copy the public key signaturecopy it to the clipboard
@timbophillips
timbophillips / angular.json
Created November 16, 2019 23:49
modification to after ng add apollo-angular to include websockets and proxy (in this case with a local hasura server)
......
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "apollo-hasura-learning:build",
"proxyConfig": "src/proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "apollo-hasura-learning:build:production"
@timbophillips
timbophillips / useful_sites.txt
Last active April 4, 2020 01:56
codegen angular apollog hasura graphql
https://github.com/dotansimha/graphql-code-generator/issues/2043
https://medium.com/angular-in-depth/configuring-a-angular-cli-project-with-graphql-37217f66d419
https://github.com/dotansimha/graphql-code-generator/issues/2043#issuecomment-508540316
@timbophillips
timbophillips / howto.txt
Created April 10, 2020 09:27
building angular packages and using them pre-publish
https://angular.io/guide/creating-libraries
in angular.json of the project calling the angular lib via the link
projects.$name.architect.build.options.preserveSymlinks: true
use npm link in the library project
https://docs.npmjs.com/cli/link.html
import { NgModule } from '@angular/core';
import { APOLLO_OPTIONS } from 'apollo-angular';
import {
ApolloClientOptions,
InMemoryCache,
split,
ApolloLink,
} from '@apollo/client/core';
import { HttpLink } from 'apollo-angular/http';
import { WebSocketLink } from '@apollo/client/link/ws';
npm init
npm i -D typescript@next ts-node nodemon dotenv eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier
npx tsc --init
mkdir src dist
echo "const writeMessage = (message: string) => { console.log(message); }; writeMessage('TS app on Node JS');" >> src/app.ts
cat << EOF
Now make the following modifications to tsconfig.
{
"compilerOptions": {