Skip to content

Instantly share code, notes, and snippets.

Manoj Nathwani Manoj-nathwani

Block or report user

Report or block Manoj-nathwani

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
View README.md

Wiring

  • Microbit USB -> laptop or power source
  • Microbit pin0 -> Arduino RX
  • Microbit GND -> Common -
  • Microbit 5V -> Common +
  • Arduino VCC -> Common +
  • Arduino GND -> Common -
  • Arduino pin8 -> Neopixel din
  • Neopixel 5v -> Common +
View pizero_blinkytape.md
@Manoj-nathwani
Manoj-nathwani / arduino.h
Created Aug 22, 2019
FastLED + DmxSimple
View arduino.h
#include <DmxSimple.h>
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 12
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 8
@Manoj-nathwani
Manoj-nathwani / remove_flickr.md
Last active Jul 31, 2019
Update Jekyll blog to self hostings images
View remove_flickr.md

Problem

  • My Jekyll blog uses hundrads of images on flickr for free image hosting
  • buuuuuuuut it's 2019 now and flickr is no longer free 🙈

Solution

  • Download all images hosted on flickr and save them to /images/articles/
  • Replace all image src attributes to using the new image location
@Manoj-nathwani
Manoj-nathwani / script.py
Created Jan 30, 2019
id,city,country ---> id,lat,lon
View script.py
# -*- coding: utf-8 -*-
import csv, os, time
from geopy.geocoders import Nominatim
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'data.csv')
geolocator = Nominatim()
@Manoj-nathwani
Manoj-nathwani / script.py
Created Jan 30, 2019
id,lat,lon ---> id,city,country
View script.py
# -*- coding: utf-8 -*-
import csv, os, time
from geopy.geocoders import Nominatim
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'data.csv')
geolocator = Nominatim()
@Manoj-nathwani
Manoj-nathwani / raspberry_pi_config.md
Last active May 29, 2017
Setting up a Raspberry Pi
View raspberry_pi_config.md
View chartjs
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.js"></script>
<div class="panel panel-default">
<div class="panel-heading">Price Changes</div>
<div class="panel-body">
<canvas id="myChart"></canvas>
</div>
</div>
<script>
View a.py
import time, datetime, json
import RPi.GPIO as GPIO
import picamera, dht11
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.cleanup()
instance = dht11.DHT11(pin=14)
result = instance.read()
View gist:a97634e1999715a97bdea62e5f433a86
import RPi.GPIO as GPIO
import time
def bin2dec(string_num):
return str(int(string_num, 2))
data = []
GPIO.setmode(GPIO.BCM)
You can’t perform that action at this time.