Skip to content

Instantly share code, notes, and snippets.

View nnarain's full-sized avatar
🚀
Heya!

Natesh Narain nnarain

🚀
Heya!
View GitHub Profile
@nnarain
nnarain / install.bash
Last active October 29, 2018 19:58
setup virtual can bus linux
#!/bin/bash
# install can-utils
git clone https://github.com/linux-can/can-utils.git
cd can-utils
./autogen.sh
./configure
make
sudo make install
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include "can.h"
void canInit(void);
void main(void)
{
unsigned char errorflag;
unsigned char txbuff[] = "abcd";
@nnarain
nnarain / AN3034.c
Last active May 31, 2016 12:05
HCS12 CAN Example from NXP App note
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#define ST_ID_100 0x100
#define ACC_CODE_ID100 0x2000
#define ACC_CODE_ID100_HIGH ((ACC_CODE_ID100 & 0xFF00)>>8)
#define ACC_CODE_ID100_LOW (ACC_CODE_ID100 & 0x00FF)
/* Mask Code Definitions */
@nnarain
nnarain / atom-setup.txt
Last active June 24, 2016 22:00
setup atom
Plugins
-------
minimap
todo-show
highlight-selected
minimap-highlight-selected
file-icons
open-recent
save-session
merge-conflicts
@nnarain
nnarain / ps1.txt
Created May 4, 2016 01:47
Bash Prompt PS1
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \[\033[01;33m\]\$(__git_ps1) \n~λ\[\033[00m\] "
#!/usr/bin/env python
from PIL import Image
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-i', '--image', help='image')
args = vars(parser.parse_args())
#!/usr/bin/python
import time
import sys
width = 50
def displayProgress(progress):
bar = int(progress * width)
sys.stdout.write("\r[%s%s] %.2f%%" % (("=" * bar), (" " * (width - bar)), progress * 100) )
sys.stdout.flush()
set(ASIO_ROOT "asio/include")
set(ASIO_VERSION_ROOT "asio-${ASIO_VERSION}/include")
find_path(ASIO_INCLUDE_DIR
NAMES
asio.hpp
PATHS
#
# Find Arduino Core
#
#
# @author Natesh Narain
# @since Feb 03 2016
# Find Arduino version file
file(GLOB
@nnarain
nnarain / newpost.py
Last active November 26, 2015 06:45
#!/usr/bin/python
#
# Script for generating new posts for my jekyll base blog
#
# @author Natesh Narain
import os
import datetime