Skip to content

Instantly share code, notes, and snippets.

View mayuroks's full-sized avatar

Mayur Rokade mayuroks

View GitHub Profile
@mayuroks
mayuroks / dabblet.css
Created September 8, 2012 19:22
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@charset "UTF-8";
/* CSS Document */
.span2{
height: 30px;
width: 150px;
}
@mayuroks
mayuroks / dabblet.css
Created September 8, 2012 19:27
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@charset "UTF-8";
/* CSS Document */
.span2{
height: 30px;
width: 150px;
}
@mayuroks
mayuroks / dabblet.css
Created September 8, 2012 19:28
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@charset "UTF-8";
/* CSS Document */
.span2{
height: 30px;
width: 150px;
}
@mayuroks
mayuroks / hello.py
Created June 14, 2013 03:20
python 3 Hello World
from requests import get
import sys
def do_sth:
print('Hello World !')
class VideoList(ListView):
model = Video
paginate_by = 15
template_name = "vid_index.html"
context_object_name = "vid_list"
def get_context_data(self, **kwargs):
context = super(VideoDetail, self).get_context_data(**kwargs)
context['big_video'] = Video.objects.filter(id=1)
# Iterate over vid_list in templates for
@mayuroks
mayuroks / api.js
Created January 13, 2014 15:44 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@mayuroks
mayuroks / aap.js
Created February 6, 2014 00:49
Redis express
var http = require('http'), express = require('express'), redis = require('redis'), RedisStore = require('connect-redis')(express); var redisClient = redis.createClient( 17969, '<redacted>.garantiadata.com', { auth_pass: '<redacted>' } ); var app = express(); app.use(express.cookieParser('pure cat flight grass')); app.use(express.session({ store: new RedisStore({ client: redisClient }) })); app.use(express.urlencoded()); app.use(app.router); app.get('/', function(req, res){ var html = ''; if(req.session.name) html += '<p>Welcome, ' + req.session.name + '.</p>'; html += '<form method="POST"><p>Name: ' + '<input type="text" name="name"> ' + '<input type="submit"></p></form>'; res.send(html); }); app.post('/', function(req, res){ req.session.name = req.body.name; res.redirect('/'); }); http.createServer(app).listen(3000,function(){ console.log('listening on 3000'); });
I'm using a free Redis account from Garantia Data, not that that should make a difference. Do you spot any differences between what I'm doing an
#! /usr/bin/bash
xrandr --newmode "1904x950_60.00" 149.25 1904 2016 2216 2528 950 953 963 986 -hsync +vsync
xrandr --addmode VBOX0 "1904x950_60.00"
@mayuroks
mayuroks / vimrc
Last active May 30, 2016 04:02
vimrc
set t_Co=256
set pastetoggle=<F8>
colorscheme wombat256mod
set hlsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
let g:indent_guides_auto_colors=0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
@mayuroks
mayuroks / bashrc
Created March 5, 2014 19:59
bashrc
PS1="\[\e[1;36m\]\u\[\e[0m\]\[\e[1;37m\]|\[\e[1;31m\]\h \[\e[1;32m\][\W \$?]: $ \[\e[0m\]"
alias subt='~/Downloads/Sublime\ Text\ 2/sublime_text'
WORK_HOME='~/.venvs'
source /usr/local/bin/virtualenvwrapper.sh
source /usr/local/rvm/scripts/rvm
export TERM="xterm-256color"