Skip to content

Instantly share code, notes, and snippets.

View chryss's full-sized avatar

Chris Waigl chryss

View GitHub Profile
>>> MWtoIPA = {
u' ': u' ',
u"'": u"'",
u"'\u0259": u"'\u028c",
u',': u',',
u',\u0259': u',\u028c',
u'-': u'.',
u'\\': u'/',
u'/': u'/',
u'(': u'(',
# HTML numbered entity (hex) to unicode string
>>> entity = '&#x01ce'
>>> unichr(int(entity[3:],16))
u'\u01ce'
# The .htaccess file in the folder "forum"
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_URI} ^/?register\.php.*
RewriteCond %{HTTP_REFERER} !.*eggcorns.lascribe.net.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* - [F]
# OR: in the .htaccess file in the web site root
RewriteEngine On
#!/usr/bin/env python
# encoding: utf-8
"""
localetest.py - tests collation / sort order for various Latin-script locales
Correct output:
The order for German is:
LATIN SMALL LETTER A
#include <stdio.h>
#include <string.h>
#include <locale.h>
int main (void) {
struct lconv locale_structure;
struct lconv *locale_ptr = &locale_structure;
char *a = "ä";
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <locale.h>
#define MYLOCALE "de_DE.UTF-8"
int main (void) {
struct lconv *locale_ptr;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <locale.h>
#define MYLOCALE "de_DE.UTF-8"
int widecharcomp(const wchar_t *arg1, const wchar_t *arg2)
{
#!/bin/bash
# Fixing permissions for group members. System default is UMASK 077 or 022,
# which makes file invisible to members of the group.
#
# This script recursively sets:
# * all directories under the given directory to 775
# * all files under the given directory to 664
# That is, the owner and group members have full rwx permissions,
# and others can access all directories and read, but not write/delete files.
#
@chryss
chryss / test20130902_1.json
Last active December 22, 2015 04:28
Testing a GeoJSON snippet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chryss
chryss / DryCreek2012_1.json
Last active December 22, 2015 04:29
Dry Creek Fire 2012 - Fireprogression as per AICC/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.