Skip to content

Instantly share code, notes, and snippets.

😎
I may be slow to respond.

Devan devansvd

😎
I may be slow to respond.
  • Earth
Block or report user

Report or block devansvd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@devansvd
devansvd / tmux.conf
Created Jun 12, 2019 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
View elasticsearch-cheetsheet.txt
ElasticSearch Cheat sheet
Create an Index via SENSE
PUT /movies
{
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 1
View auth-interceptor-example.ts
abstract class AuthService {
// Subject tracks the current token, or is null if no token is currently
// available (e.g. refresh pending).
private subject = new BehaviorSubject<string|null>(null);
readonly refreshToken: Observable<any>;
readonly token: Observable<string>;
constructor() {
// refreshToken, when subscribed, gets the new token from the backend,
@devansvd
devansvd / redis_cheatsheet.bash
Created Dec 13, 2018 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View redis_cheatsheet.bash
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
View angular-serve-static-proxy.js
//Angular 2 above application static server
const http = require('http');
const express = require('express');
const proxy = require('http-proxy-middleware');
const path = require('path');
const app = express();
app.use(express.static('client'));
@devansvd
devansvd / README.md
Created Oct 8, 2018 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

View my_vs _code_settings.json
{
"window.zoomLevel": 0,
"workbench.iconTheme": "vscode-great-icons",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"editor.wordWrap": "off",
"git.enabled": false,
"git.autofetch": false,
"telemetry.enableTelemetry": false,
View 1-handlebars-cheatsheet.hbs
Handlebars es un sistema de plantillas web semantico iniciado por Yehuda Katz en el 2010.
Handlebars.js es una extensión de Mustache, y además de renderear plantillas propias de Handlebars,
puede renderear plantillas Mustache.
More: http://handlebarsjs.com/
http://mustache.github.io/mustache.5.html
1. Expresiones.
1.1 Uso básico.
@devansvd
devansvd / .js
Created Mar 19, 2018
callback to promise example
View .js
const getCourses = () => {
return new Promise( (resolve, reject) => {
S3.getObject({
Bucket: 'your-bucket-here',
Key: 'your-file.json'
}, function (err, data){
if (err !== null){
reject(err)
}
resolve(JSON.parse(data.Body.toString('utf-8')))
@devansvd
devansvd / letsencrypt_2017.md
Created Mar 4, 2018 — forked from cecilemuller/letsencrypt_2019.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)
View letsencrypt_2017.md

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

You can’t perform that action at this time.