Skip to content

Instantly share code, notes, and snippets.

View prethiee's full-sized avatar

Preethi prethiee

  • India
View GitHub Profile
@prethiee
prethiee / ssh-key-gen.txt
Created January 23, 2023 18:10
ssh-key-gen
ssh-keygen
cat ~/.ssh/id_rsa.pub
sudo systemctl restart ssh
@prethiee
prethiee / bash_terminal_color_encoding.txt
Last active January 23, 2023 18:11
bash_terminal_color_encoding
CYAN="\[\e[01;36m\]"
WHITE="\[\e[01;37m\]"
BLUE="\[\e[01;34m\]"
TEXT_RESET="\[\e[00m\]"
TIME="\D{%F %T} \u@\h:"
CURRENT_PATH="\w"
ROOT_OR_NOT="\$"
export PS1="${CYAN}[${BLUE}${TIME}${WHITE} ${CURRENT_PATH}${CYAN}]${ROOT_OR_NOT}${TEXT_RESET} "
@prethiee
prethiee / Naming based on EXIF Create Date.txt
Last active October 16, 2021 10:12
linux-shell: renaming files to creation time
for f in *.jpg
do
mv -n "$f" "$(exiftool -d "%d-%b-%Y_%H:%M:%S" -CreateDate "$f" | awk '{print $4".jpg"}')"
done
<?php
/**
* {@inheritdoc}
*/
public function storeCommentsByDrupalOrgUser($uid, UserInterface $user) {
foreach ($this->contribRetriever->getDrupalOrgCommentsByAuthor($uid) as $comment) {
$nid = $comment->node->id;
$link = sprintf("https://www.drupal.org/node/%s", $nid);
@prethiee
prethiee / ladder.md
Created July 28, 2019 09:49 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@prethiee
prethiee / Smooth_Image_Photoshop.txt
Created April 27, 2019 14:23
Photoshop commands to smooth image
Smooth Picture in Ps
--------------------
Duplicate Layer
ctrl+i
Blend mode >> vivid light
Filter >> other >> High pass >> 24
Filter >> Gaussian blur >> 3/4
Negative Mask
Brush
Foreground color >> white
@prethiee
prethiee / Tablet_Phone_media_query.css
Created April 26, 2019 15:01
Media query for phone and tablet (iPhone, iPad, android).
/****** START - iPhone ******/
@media screen and (min-width: 320px) and (max-width: 767px) {
/**
code here
**/
}
/****** START - iPad ******/
@media screen and (min-width: 768px) and (max-width: 992px) {
/**
code here
@prethiee
prethiee / List_Of_Cat_Breeds.txt
Created April 26, 2019 14:55
List of cat breeds from wiki - code snippet to get the values
Abyssinian
Aegean
American Curl
American Bobtail
American Shorthair
American Wirehair
Aphrodite Giant
Arabian Mau
Australian Mist
Asian
@prethiee
prethiee / star_rating_average.js
Created April 26, 2019 14:51
Code to calculate the five-star rating average and display them
/**
* Star Rating Average
*/
$(document).ready(function() {
if ($("select[name=vote]").hasClass("ajax-processed")) {
var avgStar = $("#fivestar-custom-widget").find(".star-summary.star-summary-avaerage-count").find(".average-rating").find("span").text();
$("#star-custom-widget").find(".star-widget.clearfix.star-widget-5").addClass(".star-widget-static");
var starNumber = avgStar * 10;
var starColor = starNumber % 10;
if (starColor != null) {
@prethiee
prethiee / LAMP server installation on Ubuntu.txt
Last active August 3, 2019 14:12
LAMP server installation on Ubuntu step by step guide
Install four packages to install a fully functioning LAMP stack.
1.Apache
2.MySQL
3.PHP
4.phpMyAdmin
STEP 1:
Switching to the root user
sudo su -