Skip to content

Instantly share code, notes, and snippets.

View ishankhare07's full-sized avatar
πŸ‘¨β€πŸ’»

Ishan Khare ishankhare07

πŸ‘¨β€πŸ’»
View GitHub Profile
@ishankhare07
ishankhare07 / dumps.log
Last active August 29, 2015 14:24
dumps
{0=>7,
1=>1436615004374.0,
9=>26,
2=>
[{0=>9,
1=>1436615004217.0,
2=>
[{12=>"process_incoming_request",
13=>"Rbkit::Server#process_incoming_request",
6=>"/Users/ishan/Desktop/rbkit/lib/rbkit/server.rb",
@ishankhare07
ishankhare07 / shuffle.rb
Created June 12, 2015 11:33
ruby permutations
def shuffle(number)
ret_arr = []
f = fact(number.to_s.size)
count = 0
while count < f/2 do
if count == 0
ret_arr.push(number)
ret_arr.push(number.to_s.reverse.to_i)
else
num_arr = number.to_s.split(//)
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<div class="gradient">
</div>
@ishankhare07
ishankhare07 / weather.py
Last active August 29, 2015 14:19
weather notification
from gi.repository import Notify
import requests
import time
import os
import sys
class notification:
"""
To run this script, simply type:
python3 weather.py [time_interval] city &
@ishankhare07
ishankhare07 / get.py
Last active August 29, 2015 14:18
python socket GET request
import socket
class Get:
"""
this class makes get request to httpbin
"""
def __init__(self):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,0)
@ishankhare07
ishankhare07 / omega.py
Created March 25, 2015 13:59
cProfile based python profiling an omega network perfect shuffle simulation
#simulate omega network
import math
import sys
import cProfile, pstats
class simulate:
def __init__(self):
self.a = range(int(input('Enter number of inputs:')))
self.b = self.a[:]
self.count = int(math.log(len(self.a),2))
@ishankhare07
ishankhare07 / keypress.html
Last active August 29, 2015 14:16
javascript detecting keypress
<!DOCTYPE html>
<html>
<head>
<title>key test</title>
</head>
<script>
window.onkeypress = check_return;
function check_return(event) {
@ishankhare07
ishankhare07 / testing.py
Last active August 29, 2015 14:15
gtkSource comaptibility importer
from gi.importer import DynamicImporter
DynamicImporter('GtkSource')
<gi.importer.DynamicImporter object at 0xb6e131ec>
@ishankhare07
ishankhare07 / interface object
Created January 22, 2015 14:17
java interface implementation via object creation
interface onClickListener {
public void onClick();
}
public class Practice {
public static void main(String[] args) {
onClickListener my_listener = new onClickListener() {
@Override
public void onClick() {
System.out.println("this is a demo");
@ishankhare07
ishankhare07 / class implements
Created January 22, 2015 14:15
interface implementation through a class
interface onClickListener {
public void onClick();
}
public class Practice implements onClickListener {
@Override
public void onClick() {
System.out.println("this is a demo");
}