This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use of python311 with dependencies, binaries, and other aspects of the environment with nix under IntelliJ. | |
# Instruct IntelliJ to use this script by specifying a path to this file as the "system" python interpreter. | |
# Make sure this file is named `python311` (IntelliJ may otherwise reject it) executable by running `chmod +x ...``. | |
# | |
# If a `shell.nix` file is located in the same path as this wrapper script, its contents will be used in addition to | |
# the dependencies listed below via `-p`. | |
# | |
# Copyright (C) 2032 Aryeh Hillman ([email protected]) | |
# Permission to copy and modify is granted under the AGPLv3 license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>nix.lorri</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>lorri</string> | |
<string>daemon</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Network.HTTP.Conduit (simpleHttp) | |
import qualified Data.ByteString.Lazy as L | |
import qualified Data.ByteString.Lazy.Char8 as C | |
import Text.XML.HXT.Core | |
import Data.List | |
urbanDictionaryURL :: String | |
urbanDictionaryURL = "https://www.urbandictionary.com/random.php" | |
getRandomUrbanEntry :: IO String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Little program to remove c-like comments from input given via standard in | |
import fileinput | |
from sys import stdout | |
COMMENT_OPEN = False | |
OPEN_COMMENT = '/*' | |
CLOSE_COMMENT = '*/' | |
OPEN_COMMENT_IDX = 0 | |
CLOSE_COMMENT_IDX = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
Module: urban.hs | |
Description: Grabs example sentences for a random term from Urban Dictionary | |
Copyright: June 18, 2014 | |
License: MIT | |
Maintainer: [email protected] | |
Stability: experimental | |
Portability: portable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils import simplejson | |
class JSONMiddleware(object): | |
def process_request(self, request): | |
request.JSON = None | |
if request.is_ajax(): | |
if request.META.get('CONTENT_TYPE').count('application/json'): | |
try: | |
request.JSON = simplejson.loads(request.body) | |
except simplejson.JSONDecodeError: |