Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂

Alexander Schmidt Bloggerschmidt

🙂
View GitHub Profile
View settings.json
{
"peacock.favoriteColors": [
{
"name": "Angular Red",
"value": "#b52e31"
},
{
"name": "Auth0 Orange",
"value": "#eb5424"
},
@Bloggerschmidt
Bloggerschmidt / iterator.js
Created Apr 28, 2020 — forked from jed/iterator.js
Turning callbacks into async iterators, with a React hook-like API.
View iterator.js
// Example usage:
//
// void async function() {
// let [clicks, onclick] = iterator()
// document.querySelector('button').addEventListener('click', onclick)
// for await (let click of clicks) console.log(click)
// }()
export default function iterator() {
let done = false
@Bloggerschmidt
Bloggerschmidt / PhpStorm Keyboard Shortcuts.md
Created Feb 12, 2019 — forked from koomai/PhpStorm Keyboard Shortcuts.md
Frequently Used PhpStorm Keyboard Shortcuts
View PhpStorm Keyboard Shortcuts.md

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@Bloggerschmidt
Bloggerschmidt / git-merge.txt
Created Sep 6, 2017
merge branch to master in git
View git-merge.txt
// merge branch test to master
git checkout master
git pull origin master
git merge test
git push origin master
git branch -d test
@Bloggerschmidt
Bloggerschmidt / sanitizehtml.pipe.ts
Last active Dec 13, 2019
angular 4 pipe for bypass security trust html
View sanitizehtml.pipe.ts
// <div [innerHTML]="your.value | sanitizeHtml" ></div>
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({name: 'sanitizeHtml'})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private _sanitizer:DomSanitizer) {
}
transform(v:string):SafeHtml {
@Bloggerschmidt
Bloggerschmidt / lab2hub.txt
Last active Aug 21, 2017
git move from gitlab to github
View lab2hub.txt
# first create an empty repo on GitHub
git remote add github https://yourLogin@github.com/yourLogin/yourRepoName.git
git push --mirror github
git remote rename origin gitlab
git remote rename github origin
@Bloggerschmidt
Bloggerschmidt / round.ts
Last active May 24, 2019
math round in typescript
View round.ts
// round(1234.5678, 2); // 1234.57
round(number, precision) {
var factor = Math.pow(10, precision);
var tempNumber = number * factor;
var roundedTempNumber = Math.round(tempNumber);
return roundedTempNumber / factor;
};
@Bloggerschmidt
Bloggerschmidt / paste-and-indent.js
Created May 29, 2017
sublime text - paste and indent
View paste-and-indent.js
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
// linux and windows
//{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
//{ "keys": ["ctrl+shift+v"], "command": "paste" }
@Bloggerschmidt
Bloggerschmidt / app.const.ts
Created May 3, 2017
using constants in angular 2
View app.const.ts
'use strict';
export const dist = '../path/to/dist/';
export const version: string = '0.0.1';
@Bloggerschmidt
Bloggerschmidt / tsconfig.json
Created Apr 26, 2017
tsconfig.json for angular2 with lib:dom to find localStorage
View tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "../dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
You can’t perform that action at this time.