Skip to content

Instantly share code, notes, and snippets.

View kra3's full-sized avatar
🤠
I may be slow to respond.

Arun Karunagath kra3

🤠
I may be slow to respond.
View GitHub Profile
@kra3
kra3 / tictactoe.py
Created May 11, 2011 15:29
Retro "Tic Tac Toe" in python, wrote for fun
#! /usr/bin/env python
# All right reserved. Distributed Under BSD Lisence
__author__="Arun.K.R <[email protected]>"
__date__ ="$May 11, 2011 6:23:17 PM$"
import os, time
from random import choice
WIDTH = 3
@kra3
kra3 / moveit_moveit.py
Created October 12, 2011 11:28
To keep your mouse busy, so you will be always online in IM even if you are not at desk.
__author__ = "Arun K Rajeevan (kra3)"
__copyright__ = "Copyright 2011-2012"
__license__ = "BSD"
__version__ = "2"
__email__ = "[email protected]"
__status__ = "Production"
import time
import ctypes
@kra3
kra3 / discriptor_magic.py
Created April 17, 2012 22:09
ProxyProperty: Properties with proxy & instance varibale emulation
# -*- coding: utf-8 -*-
__author__ = "Arun KR (kra3) <[email protected]>"
__license__ = "Simplified BSD"
'''
Can be found at: https://gist.github.com/2409397
Public Clone URL: git://gist.github.com/2409397.git
Private Clone URL: [email protected]:2409397.git
'''
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 17, 2024 13:10
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@kra3
kra3 / license.md
Last active December 21, 2015 00:59 — forked from hmarr/gist:1013596
Couple of virtualenvwrapper hooks
@kra3
kra3 / django_south_demystified.sh
Last active December 23, 2015 11:01
Django south demystified
# Install and south to your django app
pip install south
# Add south to INSTALLED_APPS list of settings.py
vi settings.py
#-------------------------------------------
# A syncdb will create required south tables (now on only use `migrate` command)
python manage.py syncdb
## PS: (migration) generations are kept in a `/migrate/` sub directory of apps and are simple python files.
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active November 14, 2024 15:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@davegurnell
davegurnell / TypeclassDemo.scala
Created October 6, 2015 14:53
Example of the type class pattern in Scala
object TypeclasseDemo {
// The parts of the type class pattern are:
//
// 1. the "type class" itself -- a trait with a single type parameter;
//
// 2. type class "instances" for each type we care about,
// each marked with the `implicit` keyword;
//
// 3. an "interface" to the type class -- one or more methods
@jahe
jahe / spring-boot-cheatsheet.java
Last active October 8, 2024 00:10
Spring Boot Cheatsheet
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@kyle-eshares
kyle-eshares / models.py
Created October 15, 2016 18:01
Strict ForeignKeys
from __future__ import unicode_literals
from django.db import models
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor # noqa
class RelationNotLoaded(Exception):
pass