https://gist.github.com/jaytaylor/3660565
    Is it ironic that this function is written in camel case, yet it
    converts to snake case? hmm..
199135
def camelToSnake(s):
    
    _underscorer1 = re.compile(r'(.)([A-Z][a-z]+)')
    _underscorer2 = re.compile('([a-z0-9])([A-Z])')

    subbed = _underscorer1.sub(r'\1_\2', s)
    return _underscorer2.sub(r'\1_\2', subbed).lower()
458200
function snakeCase(str) {
            return camelCase(str).replace(reCamelCase, function (all, letter) {
                return "-" + letter.toLowerCase();
            });
        }
752555
def camel_to_snake(name):
    
    s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
    return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
931919
function snakeCase (str) {
  return str
    .replace(/([a-z])([A-Z])/g, match => match[0] + '_' + match[1])
    .replace(invalidChars, '_')
    .toLowerCase()
}
862098
function snake_case(name){
    var regexp = /[A-Z]/g;
    var separator = '-';
    return name.replace(regexp, function(letter, pos) {
      return (pos ? separator : '') + letter.toLowerCase();
    });
  }
456098
def _camel_killer(attr):
    
    try:
        attr = str(attr)
    except UnicodeEncodeError:
        attr = attr.encode("utf-8", "ignore")

    s1 = _first_cap_re.sub(r'\1_\2', attr)
    s2 = _all_cap_re.sub(r'\1_\2', s1)
    return re.sub('_+', '_', s2.casefold() if hasattr(s2, 'casefold')
                  else s2.lower())
836878
def camel_case(self, snake_case):
        
        components = snake_case.split('_')
        return components[0] + "".join(x.title() for x in components[1:])
93184
def camel_to_snake(camel):
    """"""
    ret = []
    last_lower = False
    for char in camel:
        current_upper = char.upper() == char
        if current_upper and last_lower:
            ret.append("_")
            ret.append(char.lower())
        else:
            ret.append(char.lower())
        last_lower = not current_upper
    return "".join(ret)
330151
def _to_camel_case(string):
        
        components = string.split('_')
        return '%s%s' % (
            components[0],
            ''.join(c.title() for c in components[1:]),
        )
906824
def snake2ucamel(value):
    """"""
    UNDER, LETTER, OTHER = object(), object(), object()
    def group_key_function(char):
        if char == "_":
            return UNDER
        if char in string.ascii_letters:
            return LETTER
        return OTHER
    def process_group(idx, key, chars):
        if key is LETTER:
            return "".join([chars[0].upper()] + chars[1:])
        if key is OTHER     \
        or len(chars) != 1  \
        or idx in [0, last] \
        or LETTER not in (groups[idx-1][1], groups[idx+1][1]):
            return "".join(chars)
        return ""
    raw_groups_gen = itertools.groupby(value, key=group_key_function)
    groups = [(idx, key, list(group_gen))
              for idx, (key, group_gen) in enumerate(raw_groups_gen)]
    last = len(groups) - 1
    return "".join(itertools.starmap(process_group, groups))
937844
function (input) {
        function camelCaseSingle(input) {
        return String(input).toLowerCase().replace(/[-|\s](.)/g, function (match, group1) {
            return group1.toUpperCase();
        });
        }

        if(typeof input == 'string')
            return camelCaseSingle(input);
        else
            return input.map(camelCaseSingle);
    }
210127
public static String camelCaseToSnakeCase(String camelCase) {
		if (null == camelCase || camelCase.length()==0)
			return camelCase;
		StringBuilder snakeCase = new StringBuilder(camelCase.length()+3);
		snakeCase.append(camelCase.charAt(0));
		boolean hasCamelCase=false;
		for (int i = 1; i < camelCase.length(); i++) {
			char c = camelCase.charAt(i);
			if (Character.isUpperCase(c)) {
				snakeCase.append("-");
				c = Character.toLowerCase(c);
				hasCamelCase=true;
			}
			snakeCase.append(c);
		}
		if (!hasCamelCase)
			return camelCase;

		return snakeCase.toString();
	}
941103
def to_snake_case(s):
    """"""
    return re.sub('([^_A-Z])([A-Z])', lambda m: m.group(1) + '_' + m.group(2).lower(), s)
869550
function camelize()
{
  return function(input, output)
  {
    var target = output || input;
    var f = output ? remove : add;

    for (var key in target) {
      var value = target[key];
      var key_ = f(key);
      if (key_ === key) continue;
      delete target[key];
      target[key_] = value;
    }

  };
}
717153
function camelCase(s) {
    // Convert first character to lowercase
    return s.replace(/^\w/, function (match) {
        return match.toLowerCase();
    })
    .replace(/-\w/g, function (match) {
        return match.charAt(1).toUpperCase();
    });
}
753356
def _snake_to_camel_case(value):
    """"""
    words = value.split("_")
    return words[0] + "".join(map(str.capitalize, words[1:]))
93275
function camelCase(text) {
    text = text || '';
    return text.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => {
        return index === 0 ? letter.toLowerCase() : letter.toUpperCase();
    }).replace(/\s+/g, '');
}