Skip to content

Instantly share code, notes, and snippets.

@evgenidb
evgenidb / math_expression_class.rb
Created December 1, 2014 21:12
Solution for the math expression validation problem
# The version I did during the class.
# This is only the regex. Replace it in the above code for it to work.
# Note: this is untested!!! Might have some bugs or missing '\s*'s
%r{
# Named Groups declarations
(?<sign>
[-+]?
){0}
@evgenidb
evgenidb / gist:861242
Created March 8, 2011 22:33
fmi.py-bg.net - bad coding 1
#Example 1:
# Wrong way:
if 1 > 0: print("Hello, World!")
# Correct way:
if 1 > 0:
print("Hello, World!")
@evgenidb
evgenidb / gist:861321
Created March 8, 2011 23:10
fmi.py-bg.net - bad coding 3
#Example 3:
#Wrong way
if True:
print("Hello, ")
print("World!")
else:
print("Bye, ")
print("World!")
@evgenidb
evgenidb / gist:861311
Created March 8, 2011 23:06
fmi.py-bg.net - bad coding 2
#Example 2:
#First row of the block - 4 spaces, second row - tab (or was it vice versa?):
if True:
print("Hello")
print("World!")
@evgenidb
evgenidb / Snake_Game_-_Background_Map_Test.py
Created August 19, 2011 20:19
Snake Game - Background Map Test
try:
import pygame
from pygame.locals import *
import sys, os, random
except ImportError as err:
print ('{0} Failed to Load Module: {1}').format(__file__, err)
sys.exit(1)
"""
Interface to the FreshDesk API.
Author: Ed Menendez (ed@menendez.com)
Company: Digital Haiku
Created: September 1, 2014
Example settings:
FRESHDESK_URL = 'https://wpt.freshdesk.com'