Skip to content

Instantly share code, notes, and snippets.

View mgscreativa's full-sized avatar

MGS Creativa mgscreativa

View GitHub Profile
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { FilesCollection } from 'meteor/ostrio:files';
import * as fs from 'fs';
import multer from 'multer';
export const Avatars = new FilesCollection({
collectionName: 'avatars',
allowClientCode: false,
onBeforeUpload: function (file) {
@PeterJuel
PeterJuel / gist:2634518
Created May 8, 2012 12:15
PHP: Import huge SQL file to MySQL
$mysqli = new mysqli('localhost', '#username', '#password', '#database');
$handle = fopen('sqldump.sql', 'rb');
if ($handle) {
while (!feof($handle)) {
// This assumes you don't have a row that is > 1MB (1000000)
// which is unlikely given the size of your DB
// Note that it has a DIRECT effect on your scripts memory
// usage.
$buffer = stream_get_line($handle, 1000000, ";\n");