Skip to content

Instantly share code, notes, and snippets.

View prrraveen's full-sized avatar

Praveen Yadav prrraveen

View GitHub Profile
def solution(xs):
fat = 0
fiber = 0
carbs = 0
for x in xs:
if re.search('FAT', x):
fat += 1
elif re.search('FIBER',x):
fiber += 1
else:
ProgramPage/ProgramCalendar.jsx|10 col 68| const ColoredDateCellWrapper = ({programStartDate, programEndDate})=> ({children, value}) => {
ProgramPage/ProgramCalendar.jsx|68 col 25| onNavigate={(date) => { setCurrentDate({ date: moment(date) }) }}
||
HomePage/HomepageWrapper.jsx|32 col 33| .then(({ data: { results }}) => {
||
ProgramPage/index.js|41 col 9| },() => {
ProgramPage/index.js|59 col 34| .then(({ data: { results } }) => {
ProgramPage/index.js|73 col 55| const defaultSubProgram = sub_programs.find(item => (item.title === 'DEFAULT'));
ProgramPage/index.js|94 col 32| .then(({data: { results }}) => {
ProgramPage/index.js|96 col 31| eventChunks.forEach(event => {
filetype off " required
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'tpope/vim-vinegar'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'altercation/vim-colors-solarized'
Plug 'rking/ag.vim'
Plug 'vim-syntastic/syntastic'
KeyError at /business/template_item/
'menu_category'
Request Method: POST
Request URL: http://localhost:8000/business/template_item/?template_id=1&token=01deda086b9e96435d71599443a324ba0a1a67e0
Django Version: 1.11.16
Python Executable: /home/praveen/proj/env/bin/python
Python Version: 2.7.15
Python Path: ['/home/praveen/proj/voltbe2', '/home/praveen/proj/voltbe2', '/home/praveen/proj/env/lib/python27.zip', '/home/praveen/proj/env/lib/python2.7', '/home/praveen/proj/env/lib/python2.7/plat-linux2', '/home/praveen/proj/env/lib/python2.7/lib-tk', '/home/praveen/proj/env/lib/python2.7/lib-old', '/home/praveen/proj/env/lib/python2.7/lib-dynload', '/usr/lib64/python2.7', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib/python2.7/lib-tk', '/home/praveen/proj/env/lib/python2.7/site-packages', '/opt/pycharm-professional/helpers/pycharm_matplotlib_backend', '/home/praveen/proj/voltbe2']
Server time: Tue, 23 Oct 2018 13:45:02 +0000
Collecting git+git://github.com/bkvirendra/django-admin-ip-whitelist.git@1801b058840acceabd64b0573e94a49fe840ba24 (from -r requirements.txt (line 142))
Cloning git://github.com/bkvirendra/django-admin-ip-whitelist.git (to revision 1801b058840acceabd64b0573e94a49fe840ba24) to /tmp/pip-req-build-dESo0J
Requirement already satisfied (use --upgrade to upgrade): django-admin-ip-whitelist==0.1.5 from git+git://github.com/bkvirendra/django-admin-ip-whitelist.git@1801b058840acceabd64b0573e94a49fe840ba24 in /home/praveen/proj/env/lib/python2.7/site-packages (from -r requirements.txt (line 142))
Requirement already satisfied: Django==1.11.15 in /home/praveen/proj/env/lib/python2.7/site-packages (from -r requirements.txt (line 1)) (1.11.15)
Requirement already satisfied: Pillow==4.2.1 in /home/praveen/proj/env/lib/python2.7/site-packages (from -r requirements.txt (line 2)) (4.2.1)
Requirement already satisfied: Pygments==2.2.0 in /home/praveen/proj/env/lib/python2.7/site-packages (from -r requirements.txt (line 3)) (2
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
const App = () => (
<Router>
<div>
<ul>
@prrraveen
prrraveen / tracback.bash
Created September 17, 2018 14:19
tracback.bash
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-2.7/pylibmc
//uint32_t kb = 128;
//uint32_t byteIn1KB = 1024;
//uint32_t flashSize = kb * byteIn1KB;
//
//uint32_t blSize = 8192;
//
//uint32_t appFlashSection = flashSize - blSize;
uint8_t foo[pageSize];
uint32_t partition2 = 61440;
@prrraveen
prrraveen / main.c
Created July 23, 2018 11:31
jump to bootloader from main app
#include <avr/io.h>
#include <util/delay.h>
#include <avr/wdt.h>
typedef void (*do_reboot_t)(void);
const do_reboot_t do_reboot = (do_reboot_t)((FLASHEND-1023)>>1);
int main (void)
{
DDRB = 0xFF;
pagelen_t saveLength= 128;
uint8_t desttype = 'F';
uint16_t part1dec = 0;
uint16_t part2dec = 16384; //PART2 addr in dec
uint16_t i;
for (int j = 0; j < 20; j++) {
uint8_t foo[128];