Skip to content

Instantly share code, notes, and snippets.

View arn-ob's full-sized avatar
☠️
__worker__

Arnob arn-ob

☠️
__worker__
View GitHub Profile
@arn-ob
arn-ob / rename.py
Created October 15, 2018 16:50
File Rename using python
import os
import re
try:
for filename in os.listdir("."):
p = re.compile(r'(p.\d.)')
ms = re.findall(r'(\d.)', filename)
filename2 = p.sub('', filename)
if filename.endswith(".mp4"):
number = ms.pop()
@arn-ob
arn-ob / gsmtracking.ino
Created September 26, 2018 19:51
GSM based Tracking System by using NEO 06
#include <SoftwareSerial.h>
#include <ArduinoJson.h>
#include <Http.h>
#include <TinyGPS.h>
#include <string.h>
/* This sample code demonstrates the normal use of a TinyGPS object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
@arn-ob
arn-ob / gsm800l.ino
Created September 26, 2018 17:10
GSM 800l working API code. It make a post method to server.
#include <ArduinoJson.h>
#include <Http.h>
unsigned long lastRunTime = 10;
unsigned long waitForRunTime = 100;
unsigned int RX_PIN = 10;
unsigned int TX_PIN = 11;
int RST_PIN = 12;
HTTP http(9600, RX_PIN, TX_PIN, RST_PIN);
@arn-ob
arn-ob / canDeactivate.ts
Last active September 24, 2018 18:18
For the canDeactivate blog at Medium
canDeactivate() {
// if the user name is not null then it will proced
if ( this.user.name !== null) {
return true;
} else {
if(confirm("Are you sure!")){
return true;
}else{
return false;
}
@arn-ob
arn-ob / router.js
Created September 24, 2018 18:13
For a Medium Blog
const appRoutes: Routes = [
{ path: 'user', component: UserComponent, canDeactivate: [GurdGuard] },
];
@arn-ob
arn-ob / gurd.ts
Last active September 24, 2018 18:12
CanDeactivate interface code
import { Injectable, Component } from '@angular/core';
import { CanDeactivate } from '@angular/router';
import { Observable } from 'rxjs/Observable';
export interface CanComponentDeactivate {
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
}
@Injectable()
export class GurdGuard implements CanDeactivate<CanComponentDeactivate> {
@arn-ob
arn-ob / recycling.ino
Last active August 2, 2021 10:12
Shaibal Final Project [Plastic Bottle Recycling]
#include <Servo.h>
#include "HX711.h"
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 32, en = 30, d4 = 28, d5 = 26, d6 = 24, d7 = 22;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// Weight
@arn-ob
arn-ob / gui.py
Created September 3, 2018 10:19
Run FullScreen GUI App At Linux
#!/usr/bin/env python
import gtk
import webkit
import gobject
gobject.threads_init()
win = gtk.Window()
bro = webkit.WebView()
bro.open("http://www.google.com")
win.add(bro)
@arn-ob
arn-ob / main.c
Last active July 30, 2018 04:54
Atmega32 chip programming with ADC
/*
* LDRCode.c
*
* Created: 7/30/2018 09:47:05 AM
* Author : Arnob
*/
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
@arn-ob
arn-ob / fbget.py
Last active June 3, 2018 14:19
Get Profile Info from facebook
"""
Created on Sun Jun 3 19:55:01 2018
@author: Arnob
"""
# pip install facebook-sdk
# make sure u install this properly
import facebook
"""