Skip to content

Instantly share code, notes, and snippets.

View parasharrajat's full-sized avatar

Rajat parasharrajat

  • India
View GitHub Profile
@parasharrajat
parasharrajat / Email Server (Linux, Unix, Mac).md
Created October 8, 2021 07:36 — forked from raelgc/Email Server (Linux, Unix, Mac).md
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@parasharrajat
parasharrajat / text_overflow.js
Created March 4, 2021 21:09 — forked from joshwnj/text_overflow.js
detect text overflow and crop, inserting an ellipsis
var TextOverflow = {
crop: function(elm) {
var w = elm.width(),
t = elm.text(),
child;
elm.html('<span style="overflow: hidden; white-space: nowrap">'+t+'</span>');
child = elm.children(":first-child");
while (t.length > 0 && child.width() > w) {
t = t.substr(0, t.length - 1);
@parasharrajat
parasharrajat / feedgroup.groovy
Created December 29, 2020 13:56 — forked from wingyplus/feedgroup.groovy
Facebook group feed json
@Grapes(
@Grab(group='com.google.code.gson', module='gson', version='2.1')
)
import com.google.gson.JsonParser
import groovy.json.JsonOutput
def feed = 'https://graph.facebook.com/136284706423146/feed?access_token=AAACEdEose0cBAAVRXgYnx5ZA24b9HK9ROQRSJN4EoSZBU8xbI0ZAE9bJmEm6lf2kF9yPcr8t74nuFNKdABNoL88Mc8F9jEpU70Y17O9CpBucO00TbJq'
def json = new JsonParser().parse(feed.toURL().text)
@parasharrajat
parasharrajat / ImageTools.js
Created July 30, 2020 12:59 — forked from SagiMedina/ImageTools.js
Resize and crop images in the Browser with orientation fix using exif
import EXIF from 'exif-js';
const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() {
try {
return Boolean(new Blob());
} catch (error) {
return false;
}
}());
@parasharrajat
parasharrajat / svg2ico.sh
Created June 3, 2020 16:57 — forked from azam/svg2ico.sh
Convert SVG to ICO using ImageMagick, with transparent background and multi-size icons
convert -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 favicon.ico
@parasharrajat
parasharrajat / remove-node-modules.md
Created July 24, 2019 12:04 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo

How to remove node_modules

  1. Create a .gitignore file in the git repository if it does not contain one

touch .gitignore 2. Open up the .gitignore and add the following line to the file

node_modules 3. Remove the node_modules folder from the git repository

@parasharrajat
parasharrajat / Game.re
Created January 1, 2018 13:28 — forked from busypeoples/Game.re
ReasonML Game
type field =
| O
| X;
type position = (field, field, field, field);
type unit = (position, position, position, position);
type units = list(unit);
@parasharrajat
parasharrajat / introrx.md
Created August 25, 2017 08:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@parasharrajat
parasharrajat / http_streaming.md
Created May 6, 2017 10:27 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on