Skip to content

Instantly share code, notes, and snippets.

@x011
x011 / gmail_attachment_downloader.py
Last active January 12, 2024 10:18
Gmail Attachment Downloader 2020
# 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"
@joinemm
joinemm / brightness.sh
Last active June 26, 2023 13:18
Brightness control script for arch linux
#!/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
#
@prasanthj
prasanthj / lirc-pi3.txt
Last active June 20, 2024 10:09
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
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
console.log(`%c ________________________________________
< mooooooooooooooooooooooooooooooooooooo >
----------------------------------------
\\ ^__^
\\ (oo)\\_______
(__)\\ )\\/\\
||----w |
|| ||`, "font-family:monospace")
@cmacdonnacha
cmacdonnacha / color-palette.scss
Created April 6, 2016 13:05
Material Design Color Palette
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
@zwhitchcox
zwhitchcox / prototypal-inheritance.js
Last active September 25, 2015 22:30
Classic inheritance function in javascript
// **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);
#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);
@simonista
simonista / .vimrc
Last active October 26, 2024 01:55
A basic .vimrc file that will serve as a good template on which to build.
" 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
@j-mcc1993
j-mcc1993 / Arduino_NES_Controller.ino
Last active January 1, 2016 21:19
Arduino Sketch that handles serial communication between NES controller and Arduino
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);