Skip to content

Instantly share code, notes, and snippets.

@JGustavoX
JGustavoX / arraybuffer2base64.js
Last active January 24, 2019 23:50
By default, NodeJS parse database's BLOB imagesto array buffer. This function converts array buffer to base64.
/*
* Example of use:
*
* var bytes = new Uint8Array(blob);
* img.src = 'data:image/png;base64,'+encode(bytes);
*/
function encode (input) {
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var output = "";
@JGustavoX
JGustavoX / MathUtils.java
Created June 9, 2015 21:13
Math class for know prime numbers of n-1
package mathio;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
public class MathUtils {
public PrimeNumbers primeNumbers() {
return new PrimeNumbers();
}
<?php
function getAll() {
$files = scandir(".");
$folders = array();
$images = array();
$pack = array();
foreach($files as $current) {
if($current == "." || $current == "..") {