Skip to content

Instantly share code, notes, and snippets.

View micaleel's full-sized avatar
:octocat:
I may be slow to respond.

Khalil micaleel

:octocat:
I may be slow to respond.
View GitHub Profile
@micaleel
micaleel / gist:3877802
Created October 12, 2012 07:33
Tell IIS to ignore configuration errors. Hack?
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="CacheStatic" type="Dialogue.Web.Modules.CacheStaticFilesHttpModule, Dialogue.Web" />
<add name="LowercaseUrls" type="Dialogue.Web.Modules.ForceLowercaseUrlHttpModule, Dialogue.Web" />
</modules>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
@micaleel
micaleel / gist:3941814
Created October 23, 2012 21:43
Setting ASP.NET Trust Level to Full
<system.web>
<trust level="Full" />
</system.web>
def shut_down(s):
if s.upper() == "YES":
return "Shutting down"
elif s.upper() == "NO":
return "Shutdown aborted"
else:
return "Sorry, I don't understand you."
@micaleel
micaleel / gist:7268875
Created November 1, 2013 17:31
In line 4, you're calling the str methods lower() and upper() with arguments consequently causing an error. CodeAcademy should've given you a better error message, but they didn't :(
def shut_down(s):
if s == "Yes" or s == "yes" or s == "YES":
return "Shutting down"
elif s == "No" or s == s.lower("no") or s == s.upper("no"):
return "Shutdown aborted"
else:
return "Sorry, I don't understand you."
@micaleel
micaleel / queryparser
Last active December 29, 2015 06:19
A python class that parses and rewrite feature-sentiment queries in a form that can be consumed by Solr
class QueryParser:
""" Parses and rewrite feature-sentiment queries in Solr/Lucene syntax """
def parse(self, query):
assert isinstance(query, str)
tokens = query.split()
result = []
for index in range(len(tokens)):
@micaleel
micaleel / gist:7976760
Created December 15, 2013 19:00
Changing Trust Level for ASP.NET
<configuration>
<system.web>
<trust level=”Full” />
</system.web>
</configuration>
# coding=UTF-8
from __future__ import division
import nltk
from collections import Counter
# This is a simple tool for adding automatic hashtags into an article title
# Created by Shlomi Babluki
# Sep, 2013
public class Maze {
public int counter = 0;
public char[][] maze =
{{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'},
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'},
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', '#', '#'},
{'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'},
# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""
# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""