Skip to content

Instantly share code, notes, and snippets.

View blooser's full-sized avatar

Blooser blooser

  • j-labs
View GitHub Profile
@blooser
blooser / server.ino
Last active July 30, 2018 19:49
Arduino Mini HTTP Server
#include "DHT.h"
#include <EtherSia.h>
EtherSia_ENC28J60 ether(8);
HTTPServer http(ether);
DHT dht(3, DHT11);
#define Buzzer 5
#define Diode 4
volatile boolean
@blooser
blooser / calculator.cpp
Created July 29, 2018 20:40
Calculator
#include <iostream>
#include "calculator.h"
bool isOperator(const char & check){
switch(check){
case '+':
case '-':
case '*':
case '/':
@blooser
blooser / sms.ipynb
Created July 29, 2018 20:33
Detect SMS spam
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blooser
blooser / image_recognition.ipynb
Last active April 21, 2020 19:04
Image recognition
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blooser
blooser / twitter.py
Last active July 30, 2018 19:54
Twitter crawler
from bs4 import BeautifulSoup
import re
import csv
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class Spider:
def __init__(self, url):
@blooser
blooser / air.ipynb
Created July 11, 2018 23:56
Air Quality prediction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blooser
blooser / cipher.cpp
Created July 10, 2018 13:29
Vigenere Cipher
std::string Cipher::vigenereCipher(std::string & contentToEncrypt){
std::string encrypted,
key = makeVigenereKey(contentToEncrypt);
for(int i = 0, j = 0; i < contentToEncrypt.length(); i++){
char checkChar = contentToEncrypt[i];
if(checkChar >= 'a' && checkChar <= 'z')
checkChar += 'A' - 'a';
else if(checkChar < 'A' || checkChar > 'Z')
continue;
encrypted += (checkChar += key[j] - 2*'A') % 26 + 'A';
@blooser
blooser / search.cpp
Created July 7, 2018 13:53
Files seaching
void search(std::vector<std::string> & files, const fs::path &dirRoot){
if(!fs::exists(dirRoot) || !fs::is_directory(dirRoot))
return;
fs::recursive_directory_iterator it(dirRoot);
fs::recursive_directory_iterator end;
while(it != end){
if(fs::is_regular_file(*it) && it->path().extension() == ".txt")
files.push_back(it->path().string());
it++;
}
@blooser
blooser / wc.cpp
Created July 6, 2018 22:49
Load file content into string
std::string WordsCounter::getFileContent(std::ifstream & file){
std::string data;
data.assign(std::istreambuf_iterator<char>(file),
std::istreambuf_iterator<char>());
return data;
}