Skip to content

Instantly share code, notes, and snippets.

View ilkerceng's full-sized avatar
🏠
Working from home

peja ilkerceng

🏠
Working from home
  • striker
  • Ankara/Turkey
View GitHub Profile
@ergoithz
ergoithz / xpath_soup.py
Last active January 11, 2025 16:34
Generate unique XPATH for BeautifulSoup element
#!/usr/bin/python
# -*- coding: utf-8 -*-
import bs4
def xpath_soup(element):
# type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str
"""
Generate xpath from BeautifulSoup4 element.
@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@robschmuecker
robschmuecker / README.md
Last active January 31, 2024 18:30
Drag and drop, collapsible d3.js Tree with 50,000 nodes

This is an example of a collapsible drag and drop tree implementing slightly modified code from https://gist.github.com/robschmuecker/7880033

This is posted in order to demonstrate a viable answer for a Stack Overflow question http://stackoverflow.com/questions/20539922/has-anyone-produced-a-virtualised-javascript-tree-for-thousands-of-nodes

The only difference between this gist and the one referenced above is that the JSON file has changed. Each node contains 15 children and the depth is 4. Hence over 50,000 nodes.

The performance is fine if not too many of the nodes are present at once in the DOM. The JSON was contructed at http://www.json-generator.com/ with the following markup

@DevDarren
DevDarren / hangman_1.py
Created December 4, 2012 00:41
A simple hangman game made with Python 2.7.3
class Hangman():
def __init__(self):
print "Welcome to 'Hangman', are you ready to die?"
print "(1)Yes, for I am already dead.\n(2)No, get me outta here!"
user_choice_1 = raw_input("->")
if user_choice_1 == '1':
print "Loading nooses, murderers, rapists, thiefs, lunatics..."
self.start_game()
elif user_choice_1 == '2':
@bradmontgomery
bradmontgomery / ShortIntroToScraping.rst
Created February 21, 2012 02:00
Really short intro to scraping with Beautiful Soup and Requests
@hallettj
hallettj / global-variables-are-bad.js
Created February 14, 2009 21:15
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {