Skip to content

Instantly share code, notes, and snippets.

@mrtcmn
mrtcmn / dialog.content.html
Created September 21, 2017 17:33
Material Design for Angular - Full Page Dialog Box
<md-toolbar color="primary">
<i class="material-icons" style="cursor: pointer; padding-right:16px;" (click)="onOKClick()">arrow_back</i>
<span>Title<span>
</md-toolbar>
<div md-dialog-content>
</div>
@mrtcmn
mrtcmn / main.ts
Last active October 27, 2017 19:21
import { Component} from '@angular/core';
import { FormBuilder, FormGroup, FormsModule, FormArray } from '@angular/forms'; // Import required forms modules
@Component({
selector: 'form-creator-form'
templateUrl: './formCreatorForm.component.html'
})
export class formCreatorComponent implements {
this._FormGroup = this.fb.group({
formName: '',
decs: '',
questions: this.fb.array([this.fb.group({ // First level array here. After bracet again using FormGroup function for creating AbstractControl.
question: '',
questionType: '',
answers: this.fb.array([ // Second level array here. After bracet again using FormGroup function for creating AbstractControl.
this.fb.group({ value: ''})
])
})])
<form [formGroup]="_FormGroup" (ngSubmit)="onSubmit()" novalidate>
<div [ngClass]="stylesConfig.field">
<label [ngClass]="stylesConfig.label">Form Name</label>
<div class="control">
<input [ngClass]="stylesConfig.formNameInput" type="text" placeholder="Form Name" formControlName="formName">
</div>
</div>
<div [ngClass]="stylesConfig.field">
@mrtcmn
mrtcmn / yarn init
Last active March 23, 2020 18:04
initialization project
$ yarn init
yarn init v1.22.4
question name (react-project): enter-your-project-names
question version (1.0.0): //give semantic versioning number.
question description: // brief project description is very usefull for future manitaners
question entry point (index.js): // You can enter and pass here
question repository url (https://github.com/user/repo-name): // you can pass here
question author (Murat Çimen <[email protected]>): // enter your mail name and mail adress
question license (MIT): // if your project will be opensource, i recomend to read software licensing
question private: // open source or private money maker thing?
$ git init
@mrtcmn
mrtcmn / workaround.css
Created November 27, 2020 15:04
firefox backdrop-filter workaround
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
.blurred-container {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
}
/* slightly transparent fallback for Firefox (not supporting backdrop-filter) */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
.blurred-container {
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const outputPath = path.join(__dirname, "dist")
const port = process.env.PORT || 3000;
module.exports = {
context: __dirname,
entry: './src/App.jsx',
output: {
@mrtcmn
mrtcmn / .sh
Created November 26, 2021 12:41
What the hell is this file sizes?
du -hs * | sort -hr
@mrtcmn
mrtcmn / gist:5236c947226e2daae71a53fb87214e54
Created January 19, 2022 11:19
Browser height detection
let vh = window.innerHeight * 0.01;
let vw = window.innerWidth * 0.01;
const setDimensions = (_vh, _vw) => {
const rs = _vh / _vw < 0.8 ? vh : vw;
document.documentElement.style.setProperty('--vh', `${_vh}px`);
document.documentElement.style.setProperty('--vw', `${_vw}px`);
document.documentElement.style.setProperty('--rs', `${rs}px`);
};