Skip to content

Instantly share code, notes, and snippets.

View sekcompsci's full-sized avatar
🎯
Focusing

Sirawit Moonrinta sekcompsci

🎯
Focusing
View GitHub Profile
@zfael
zfael / nodejs.checksum.js
Created June 20, 2017 13:57
NODE.JS - How to generate file's Checksum (CRYPTO)
var fs = require('fs');
var crypto = require('crypto');
fs.readFile('file.pdf', function(err, data) {
var checksum = generateChecksum(data);
console.log(checksum);
});
function generateChecksum(str, algorithm, encoding) {
return crypto
@nikhita
nikhita / update-golang.md
Last active April 27, 2024 13:09
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@brenopolanski
brenopolanski / npm-list-globally.md
Created November 1, 2016 19:34
Listing globally installed NPM packages and version
npm list -g --depth=0
@tyrell
tyrell / docker-install-rpi3.md
Last active December 22, 2023 07:36
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@Protoneer
Protoneer / SerialEcho
Created September 18, 2014 18:51
Serial Echo On Arduino
/*
* serial_echo.pde
* -----------------
* Echoes what is sent back through the serial port.
*
* http://spacetinkerer.blogspot.com
*/
int incomingByte = 0; // for incoming serial data
@falkolab
falkolab / download.js
Created July 30, 2014 08:16
Download file by http with progress (NodeJS)
function download(fileUrl, apiPath, callback) {
var url = require('url'),
http = require('http'),
p = url.parse(fileUrl),
timeout = 10000;
var file = fs.createWriteStream(apiPath);
var timeout_wrapper = function( req ) {
return function() {
@kwhinnery
kwhinnery / app.js
Created May 26, 2014 13:48
HTTP Basic Authentication with Express 4 using the http-auth module
var express = require('express'),
auth = require('http-auth');
// Configure basic auth
var basic = auth.basic({
realm: 'SUPER SECRET STUFF'
}, function(username, password, callback) {
callback(username == 'admin' && password == 'f00lpr00f');
});
@killercup
killercup / api.js
Last active June 10, 2021 22:02
Streamed CSV Export using node-restify and mongoose
/**
* # Some Demo API Service
*/
var restify = require('restify');
var map = require('map-stream');
var csvify = require('../helpers/csvify');
var Team = require("../models").Team;
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"