Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Mukundhan-I2I / CustomerDTO.java
Created January 18, 2018 11:55 — forked from dragester/CustomerDTO.java
usage example of org.hibernate.Transformers.aliasToBean
public class CustomerDTO {
private String firstName, lastName;
// getter & setters
}
@Mukundhan-I2I
Mukundhan-I2I / coordinating-async-react.md
Created April 19, 2018 07:29 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

Open Terminal.
Enter ls -al ~/.ssh to see if existing SSH keys are present:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key.
Copy the SSH key to your clipboard.
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda).
Otherwise, you can find it using this for Linux and Unix:
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
and for Windows:
git fsck --no-reflog | select-string 'dangling commit' | foreach { $bits = $_ -split ' '; echo $bits[2];}
This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.
@Mukundhan-I2I
Mukundhan-I2I / SCSS.md
Created May 9, 2018 10:42 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@Mukundhan-I2I
Mukundhan-I2I / box-shadow.html
Created May 10, 2018 07:34 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@Mukundhan-I2I
Mukundhan-I2I / border-left-width radius
Created May 18, 2018 06:23
border-left-width radius with gradient.
border-image: linear-gradient(to bottom, #f79426, #ee4b40) 1 100%;
border-left-width: 8px;
border-style: solid;
border-right-width: 0;
opacity: 0.8;
background-image: linear-gradient(277deg, rgb(33, 31, 30), rgba(222, 231, 254, 0.28));
border-bottom: 0;
border-top: 0;
padding-right: 8px;
dpkg -l | grep postgres
apt-get --purge remove postgresql\*
@Mukundhan-I2I
Mukundhan-I2I / rename remote branch
Created July 4, 2018 05:41
rename remote branch
If you really just want to rename branches remotely (without renaming any local branches at the same time) you can do this with a single command like
git push <remote> <remote>/<old_name>:refs/heads/<new_name> :<old_name>
https://stackoverflow.com/a/21302474/2586761
this.isCurrentDayAfterHalfMonth = moment().isAfter(moment().startOf('month').add('days', 15));