Skip to content

Instantly share code, notes, and snippets.

View bauripalash's full-sized avatar
👋
getting back

Palash Bauri bauripalash

👋
getting back
View GitHub Profile
<p id="error"></p>
<div class="container">
<div class="loader"></div>
<p id="name"></p>
<div class="default">Get Weather</div>
<div class="box">
<div id="temp"></div>
<div id="button-box"><span class="button activated" id="button-f">°F</span><span class="button" id="button-c">°C</span></div>
</div>
<div class="box">
@vlucas
vlucas / encryption.js
Last active December 20, 2024 19:49
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@gdalgas
gdalgas / mathjax-editing.js
Last active April 1, 2023 08:10
StackExchange MathJax editing code
// The MIT License (MIT)
//
// Copyright (c) 2016 Stack Exchange
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Arthraim
Arthraim / bottle_example.py
Created May 27, 2011 04:27
a python web framework bottle's example
#coding: utf-8
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template
@route('/')
@route('/index.html')
def index():
return '<a href="/hello">Go to Hello World page</a>'
@route('/hello')
def hello():