Skip to content

Instantly share code, notes, and snippets.

View SarathSantoshDamaraju's full-sized avatar
📽️
Doing time jumps

Krishna Sarath SarathSantoshDamaraju

📽️
Doing time jumps
View GitHub Profile
@SarathSantoshDamaraju
SarathSantoshDamaraju / css__alignment-1.css
Created February 16, 2018 07:19
CSS-- Vertically and Horizontally centre align Text to the Whole Page
/*
<body>
<p>Hello world</p>
</body>
*/
p{
margin: 0;
position: absolute;
top: 50%;
@SarathSantoshDamaraju
SarathSantoshDamaraju / css_alignment-2.css
Last active February 16, 2018 12:20
CSS -- centre align item to the div
/*
<div calss="parent">
<!-- Can be an image too -->
<p>Hello world</p>
</div>
*/
/* ============== With Flex */
div.parent {
@SarathSantoshDamaraju
SarathSantoshDamaraju / css_alignment-3
Last active February 17, 2018 08:21
CSS -- Centre align text to an image
/* Responsive */
https://codepen.io/SarathSantoshDamaraju/pen/aqyjWa
/* Not responsive layout, but image size is responsive. */
/*
<div>
<img src="" alt=""/>
<p> </p>
</div>
*/
@SarathSantoshDamaraju
SarathSantoshDamaraju / pre-commit
Last active September 3, 2018 05:40
eslint pre-commit
#!/bin/bash
# Functions:
# 1.Linting and Beautification of JS files
# 2.Linting of CSS files
# 3.Linting of HBS files
# Installation :
# 1. Go to source folder and type (cmd+shift+. in mac) to show hidden files
@SarathSantoshDamaraju
SarathSantoshDamaraju / grid.css
Created October 14, 2018 05:42
Extracted Grid from bootstrap
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 768px) {
.container {
width: 750px;
@SarathSantoshDamaraju
SarathSantoshDamaraju / script.js
Created January 30, 2019 06:26
Copy function value to clipboard with Pure JS
/* ====
ClipboardCopy: This accepts any given string and copys it into clipboard after desired operation.
==== */
function ClipboardCopy(str){
/* Some login */
str = str.toLowerCase();
let convertedStr = str.split(" ").join("-");
/* Copy code */
let $tempInput = document.createElement('INPUT');
document.body.appendChild($tempInput);
import Ember from 'ember';
import {computed} from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
data: ["One","Two","Three"],
datas : computed('data','typed', function(){
return this.data.filter(each => each.toLowerCase().includes(this.typed ? this.typed : ''));
}),
// HBS
{{#if label}}
{{label}}
{{else}}
{{yield}}
{{/if}}
// JS
import Component from '@ember/component';
@SarathSantoshDamaraju
SarathSantoshDamaraju / Comparison Table
Created August 1, 2019 07:52
Button types Comparison Table
| | innerText | value | aria-label | aria-lebelledby | role or aria-role | tabindex
alias g!='git init'
alias g.='git add .'
alias g.-file='git add'
alias gb='git branch'
alias gb-new='git checkout -b'
alias gblame='git blame'
alias gcl='git clone'
alias gc='git commit -m'
alias gcout='git checkout'
alias gd='git diff'