Skip to content

Instantly share code, notes, and snippets.

Avatar
🌩️
Brainstorming...

Ali Sawari AliSawari

🌩️
Brainstorming...
View GitHub Profile
@m-esm
m-esm / run.js
Created Feb 22, 2019
Node.js sending and receiving file using only 'http' and 'fs' module (no framework)
View run.js
var http = require("http");
var fs = require("fs");
var server = http.createServer().listen(3000);
server.on("request", function(req, res) {
if (req.method != "POST") return res.end();
var imageName = "received-" + Date.now() + ".jpg";
var writeStream = fs.createWriteStream(imageName);
req.pipe(writeStream);
@akexorcist
akexorcist / index.js
Last active Jan 15, 2021
Axios post method requesting with x-www-form-urlencoded content type
View index.js
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active Jan 13, 2021
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
View Install NVIDIA Driver and CUDA.md
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active Jan 8, 2021
A sample README for all your GitHub projects.
View sampleREADME.md

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@PurpleBooth
PurpleBooth / README-Template.md
Last active Jan 16, 2021
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@paambaati
paambaati / upload_demo_html.html
Last active Nov 30, 2020
Uploading files using NodeJS and Express 4
View upload_demo_html.html
<html>
<body>
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
</body>
</html>
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sanchitgangwar
sanchitgangwar / snake.py
Created Mar 22, 2012
Snakes Game using Python
View snake.py
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
View html5-video-streamer.js
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@banksean
banksean / mersenne-twister.js
Created Feb 10, 2010
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
View mersenne-twister.js
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
You can’t perform that action at this time.