Skip to content

Instantly share code, notes, and snippets.

View dibakarsutradhar's full-sized avatar
👾
Powered by Coffee

Dibakar dibakarsutradhar

👾
Powered by Coffee
View GitHub Profile
@dibakarsutradhar
dibakarsutradhar / Main
Created April 8, 2018 15:10 — forked from Westenburg/Main
More advanced version of foggy bummer with particles, weather and bonuses. Two tabs - Particle and Main. New to GitHub so not sure if I've implemented correctly. Written for Codea
--# Particle
Particle = class()
--Class to deal with individual particles. Used for the starburst and raindrops
function Particle:init(x,y,xspd,yspd,type,fade)
-- you can accept and set parameters here
--map to the position of the 100 by 100 blocks in the sprite sheet. The location in the array refers to the type of particle
local map={}
map[1]={x=0, y=4}--stars
map[2]={x=2, y=4}--rain
@dibakarsutradhar
dibakarsutradhar / made-with-love.html
Created May 21, 2018 14:35
HTML Love emoticon to use in Footer
<!-- to use hearts emoticon on a footer -->
<html>
<p>Made with <span id="hearts">&hearts;</span> by Dibakar</p>
</html>
@dibakarsutradhar
dibakarsutradhar / helloworld.js
Created June 16, 2018 15:22
Hello World in Nodejs
var http = require('http');
var hostname = '127.0.0.1';
var port = 8080;
var server = http.createServer(function(req, res) {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
@dibakarsutradhar
dibakarsutradhar / footer.css
Created July 24, 2018 09:49
footer for chelseabangla
const http = require('http');
const url = require('url');
const path = require('path');
const fs = require('fs');
const mimeTypes = {
"html": "text/html",
"jpeg": "image/jpeg",
"jpg": "image/jpg",
"png": "image/png",
const http = require('http');
const url = require('url');
const path = require('path');
const fs = require('fs');
const mimeTypes = {
"html": "text/html",
"jpeg": "image/jpeg",
"jpg": "image/jpg",
"png": "image/png",
if(stats.isFile()) {
var mimeType = mimeTypes[path.extname(fileName).split(".").reverse()[0]];
res.writeHead(200, {'Content-type': mimeType});
var fileStream = fs.createReadStream(fileName);
fileStream.pipe(res);
} else if (stats.isDirectory()) {
res.writeHead(302, {
'Location': 'index.html'
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Welcome Page</title>
<link rel="stylesheet" href="/css/bootstrap.css">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
@dibakarsutradhar
dibakarsutradhar / object.cpp
Created August 31, 2018 11:19
Object Example for OOP C++
class car {
char name[10];
ind id;
public:
void getDetails(){}
};
int main(){
car ferrari; // ferrari is an object
@dibakarsutradhar
dibakarsutradhar / classoop.cpp
Created August 31, 2018 11:32
Class OOP Example
class myFirst_class {
private:
// data members and member function declarations
public:
// data members and member function declarations
protected:
// data members and member function declarations
}