Skip to content

Instantly share code, notes, and snippets.

View heerdyes's full-sized avatar

Heerdyes Mahapatro heerdyes

View GitHub Profile
@heerdyes
heerdyes / prxysrvr.js
Created August 1, 2023 16:16
node proxy server
const http = require('http');
const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({});
const apisrv = '127.0.0.1:8080';
const port = 3000;
console.log(`[proxy] 127.0.0.1:${port} -> ${apisrv}`);
http.createServer(
function(req, res) {
@heerdyes
heerdyes / backend.js
Created August 1, 2023 19:02
express js backend
const express = require('express');
const app = express();
const port = 3000;
let kvs = [
{
ccode: 'JS101',
cname: 'javascript fundamentals'
},
{
@heerdyes
heerdyes / frontend.html
Created August 1, 2023 19:03
frontend html
<html>
<head>
<title>frontend</title>
<style>
table {
border-collapse: collapse;
}
tr, td {
border: 1px solid darkgreen;
}
@heerdyes
heerdyes / App.js
Last active September 7, 2023 05:07
import { useState } from 'react';
import './App.css';
function App() {
const [skey, setSkey] = useState('');
const [links, setLinks] = useState([]);
return (
<div>
<h1>hello react</h1>
@heerdyes
heerdyes / arrays00.java
Created September 29, 2023 07:09
java_snippets
import java.io.Console;
public class arrays00 {
public static void main(String[] args) {
int[] a = new int[] { 11, 55, 73, 29 };
int i = 0;
while(i < a.length) {
System.out.println(a[i]);
i++;
}
@heerdyes
heerdyes / digiclk.py
Created October 13, 2023 05:08
digital clock
import time
# number chart
zero = [
[' ', '_', '_', ' '],
['|', ' ', ' ', '|'],
['|', '_', '_', '|'],
[' ', ' ', ' ', ' ']
]
@heerdyes
heerdyes / bufzero.rb
Last active October 20, 2024 13:30
/ccjam.d/sonicpi/buffers
kc=nil
vab='0123456789abcdefghijklmnopqrstuvwxyz'
mz=[]
pz=[]
# 10 tracks each for melody and samples
10.times do
mz.append({'q'=>'....', 'o'=>60, 'sy'=>:beep, 'v'=>'tttt', 'a'=>'1111', 'r'=>'1111', 'mute'=>false})
pz.append({'q'=>'....', 'v'=>'mmmm', 'mute'=>false})
end
ctr=0
@heerdyes
heerdyes / bufone.rb
Last active October 20, 2024 14:19
/ccjam.d/sonicpi/buffers
kc=nil
t=0.16
vab='0123456789abcdefghijklmnopqrstuvwxyz'
mz=[]
# 10 tracks
10.times do
mz.append({'q'=>'....', 'o'=>60, 'v'=>'t', 'mute'=>false, 'sy'=>:mod_fm,
'mw'=>'....', 'mp'=>'....', 'mr'=>'....',
'dv'=>'2', 'dp'=>'2',
'a'=>'1', 'd'=>'1', 's'=>'1', 'r'=>'1'})
@heerdyes
heerdyes / buftwo.rb
Last active November 9, 2024 11:47
/ccjam.d/sonicpi/buffers
# ----------------- mod looper ----------------- #
kc=nil
t=0.15
vab='0123456789abcdefghijklmnopqrstuvwxyz'
mz=[]
# 10 tracks
10.times do
mz.append({'q'=>'....', 'o'=>'60', 'v'=>'t', 'mute'=>'n', 'sy'=>"mod_fm",
'mw'=>'0', 'mp'=>'1', 'mr'=>'2',
'dv'=>'2', 'dp'=>'2', 'co'=>'p', 'dt'=>'0',