Skip to content

Instantly share code, notes, and snippets.

Sham Vinicius Fiorin skatesham

Block or report user

Report or block skatesham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@skatesham
skatesham / setupgithub.py
Created Sep 13, 2018
Script Set Up Github with Python3 in command line
View setupgithub.py
#! /usr/bin/python
import subprocess
print("---------------------------------------------------")
print("Automatic Watched Set Up of Github in Python")
print("-----------by Sham Vinicius Fiorin-----------------")
print("---------------------------------------------------")
config = input("Set up configurations[N/s]?")
if('s' in config.lower()):
subprocess.run(["git", "init"])
@skatesham
skatesham / mongodb-dao.js
Created Feb 4, 2018 — forked from JavascriptMick/mongodb-dao.js
Simple Node.js Utility module to enable easy creation of models using node-mongodb-native
View mongodb-dao.js
/*
Simple Node.js Utility module to enable easy creation of models using node-mongodb-native
Useage:-
var dao = require('./mongodb-dao');
exports.NewClient = function(clientId, plan){
return {
clientId: clientId,
plan: plan,
@skatesham
skatesham / CategoryRepository.js
Created Feb 4, 2018 — forked from lifecoder/CategoryRepository.js
simple DAO example for nodejs
View CategoryRepository.js
var mongo = require('mongodb'),
EventEmitter = require('events').EventEmitter;
function Connector(settings) {
settings.port = settings.port || mongo.Connection.DEFAULT_PORT;
this.settings = settings;
this.server = new mongo.Server(settings.host, settings.port);
this.db = new mongo.Db(settings.database, this.server, {native_parser: true});
}
@skatesham
skatesham / index.js
Created Jan 22, 2018 — forked from codediodeio/index.js
Firebase Cloud Functions image thumbnail generator using Sharp for 4x faster resizing
View index.js
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const sharp = require('sharp')
const _ = require('lodash');
const path = require('path');
const os = require('os');
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => {
const object = event.data; // The Storage object.
@skatesham
skatesham / gist:70515b6b9c250f96aa199981f1214097
Created Sep 12, 2017 — forked from ilusi/gist:4205101
m101 hw5.1 to 5.4 - Aggregation Framework
View gist:70515b6b9c250f96aa199981f1214097
// $sum
db.zips.aggregate([
{ $group:
{
"_id": {
"state": "$state"
},
"population": { "$sum": "$pop" }
}
}
@skatesham
skatesham / CRUD Excepion.py
Created Aug 8, 2017 — forked from fmasanori/CRUD Excepion.py
CRUD MongoDB exception
View CRUD Excepion.py
import pymongo
import sys
def main():
connection = pymongo.MongoClient("mongodb://localhost")
db = connection.m101
people = db.people
person = {'name': 'Barack Obama', 'role':'President',
'address':{'address1':'The White House',
'street': '1600 Pensylvania Avenue',
@skatesham
skatesham / CRUD MongoDB.py
Created Aug 8, 2017 — forked from fmasanori/CRUD MongoDB.py
CRUD MongoDB Python2
View CRUD MongoDB.py
from datetime import datetime
from pymongo import MongoClient
connection = MongoClient("mongodb://localhost")
db = connection.test
post = {"title": "My Blog Post",
"content": "Here's my blog post.",
"date": datetime.utcnow()}
View Oficina MongoDB e Python FISL
Oficina MongoDB e Python - FISL
Resumo university.mongodb.com/courses/M101P/about
Install python 2.7 (provavelmente vc já tem)
https://www.python.org/downloads/
para testar python -V
Install mongoDB 3.4
https://www.mongodb.org/downloads
criar diretório \data\db com as permissões necessárias para testar bin\mongod (servidor)
@skatesham
skatesham / FunçãoVerificarBalanceamento.py
Last active Mar 16, 2016
Questão de Estrutura de Dados - Entrega 5
View FunçãoVerificarBalanceamento.py
import unittest
class Pilha():
def __init__(self):
self.lista = []
def empilhar(self, valor):
self.lista.append(valor)
def vazia(self):
@skatesham
skatesham / Duplamente.py
Last active Mar 8, 2016
Lista Encadeada Duplamente Ligada
View Duplamente.py
class ListaVaziaErro(Exception):
pass
class Noh():
def __init__(self, valor, esquerdo = None, direito = None):
self.valor = valor
self.direito = direito
self.esquerdo = esquerdo
You can’t perform that action at this time.