Skip to content

Instantly share code, notes, and snippets.

View roshnet's full-sized avatar
🏎️
working from cache

Roshan Sharma roshnet

🏎️
working from cache
View GitHub Profile
@roshnet
roshnet / members.txt
Created December 14, 2018 07:04
Members' List
Abhinav (9410200787)
Haider Ali (9027517849)
Prateek Jain (9456213922)
Roshan Sharma (8266966965)
@roshnet
roshnet / required-tools.txt
Last active March 15, 2019 08:28
List of tools to install on a newly installed Debian-based Linux distro.
MINIMAL TOOL NAMES
git, npm, yarn, preload, sublime-text-3, numpy, pandas, matplotlib, scipy
INSTALLATIONS:
sudo apt update
sudo apt install git
sudo apt install preload
sudo apt install npm
@roshnet
roshnet / counter.html
Created March 14, 2020 11:53
A simple Vue counter.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="./vue.js"></script>
<title>Document</title>
</head>
<body>
<div id="app">
package main
import (
"fmt"
"math"
)
// =======================
// The structs' definition
// =======================
package main
import (
"fmt"
"math"
)
// =======================
// The structs' definition
// =======================
function placeOrder(user) {
var order;
order.buyer = user;
order.itemName = 'Raspberry Pi';
order.itemPrice = 2500;
order.isConfirm = true;
return order;
}
var person = {
name: 'John',
var crypto = require("crypto");
var algorithm = "aes-192-cbc";
var password = "Store this password in a .env file!";
const key = crypto.scryptSync(password, 'salt', 24);
var text = "secret message";
const iv = crypto.randomBytes(16); // different each time
const cipher = crypto.createCipheriv(algorithm, key, iv);
@roshnet
roshnet / jinja2_file_less.py
Created October 3, 2020 11:03 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@roshnet
roshnet / tabcloser.cs
Last active September 13, 2021 13:27
Close Chrome tabs in C# (Windows)
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Automation;
using System.Windows.Forms;
namespace NudgeApp {
class ChromeTabBlocker {
[DllImport("user32.dll")]
public static extern int SetForegroundWindow(IntPtr hWnd);
@roshnet
roshnet / randomgame.js
Created October 30, 2021 20:51
I was bored...
import { useLayoutEffect, useState } from 'react'
const SECONDS = 0.6
export default function Game() {
const [x, setX] = useState(0)
const [y, setY] = useState(0)
const [score, setScore] = useState(0)
// Change coordinates every N seconds