This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Made for: https://stackoverflow.com/questions/61366836/download-attachment-from-mail-using-python/ | |
import os | |
from imbox import Imbox # pip install imbox | |
import traceback | |
# enable less secure apps on your google account | |
# https://myaccount.google.com/lesssecureapps | |
host = "imap.gmail.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Brightness adjuster script by Joinemm | |
# | |
# Why? | |
# My brightness adjustments werent working through xbacklight so i made this as a replacement. | |
# Just bind this to your brightness keys | |
# | |
# To remove sudo requirement, add this to /etc/udev/rules.d/backlight.rules | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]). | |
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch. | |
Following are the changes that I made to make it work. | |
$ sudo apt-get update | |
$ sudo apt-get install lirc | |
# Add the following lines to /etc/modules file | |
lirc_dev | |
lirc_rpi gpio_in_pin=18 gpio_out_pin=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(`%c ________________________________________ | |
< mooooooooooooooooooooooooooooooooooooo > | |
---------------------------------------- | |
\\ ^__^ | |
\\ (oo)\\_______ | |
(__)\\ )\\/\\ | |
||----w | | |
|| ||`, "font-family:monospace") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$white: #ffffff; | |
$black: #000000; | |
$red50: #ffebee; | |
$red100: #ffcdd2; | |
$red200: #ef9a9a; | |
$red300: #e57373; | |
$red400: #ef5350; | |
$red500: #f44336; | |
$red600: #e53935; | |
$red700: #d32f2f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// **IMPORTANT** Not compatible with <= IE10 (which makes up about 20% of browsers) | |
// Here ya go! Just put this in your global scope: | |
// Works fine with all real browsers though | |
function inherit(inhObj,self) { | |
var selfProto = Object.getPrototypeOf(self) | |
var inheritance=Object.create(inhObj.prototype); | |
for (var i in selfProto) {inheritance[i] = selfProto[i]}; | |
if (Object.setPrototypeOf) | |
Object.setPrototypeOf(self,inheritance); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
#define SSID "enter the SSID" | |
#define PASS "enter the password" | |
#define DST_IP "220.181.111.85" //baidu.com | |
SoftwareSerial dbgSerial(10, 11); // RX, TX | |
void setup() | |
{ | |
//setup RGB LED as indicator instead of softserial | |
pinMode(3, OUTPUT); | |
pinMode(4, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int latch = 7; //signals controller to latch button states | |
int pulse = 5; //toggle to shift out button states | |
int data = 9; //data in line | |
int data_byte; //byte that stores button states | |
int count[] = {0,0,0,0,0,0,0,0}; //each value stores 1 or 0 indicating whether a key is currently pressed | |
char keys[] = {'a','b','s','d','u','j','l','r'}; //keyboard keys to be pressed | |
int tempbit; //iterates over the data_byte to grab each button's state | |
void setup() { | |
pinMode(latch, OUTPUT); |
NewerOlder