Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
file="$1"
shift
clang-format $file | diff -U5 $file -
#!/usr/bin/env ruby -W
require 'pp'
require 'ostruct'
$global_stats = {
file_count: 0,
line_count: 0,
space_indent: 0,
@tiennou
tiennou / LICENSE
Last active August 30, 2016 15:39
A better-behaved getopt replacement
Copyright (c) 2016, Etienne Samson
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#!/usr/bin/env ruby -W
# encoding: utf-8
# This script takes a glob pattern as input (eg. "*.[hm]"), and reports
# indentation statistics for files matching the pattern in the current
# directory, recursively.
require 'set'
pattern = ARGV.shift
Test Case '-[TestQSObject testEquality]' started.
2016-03-23 16:06:29.880 xctest[72805:4013708] test combined 1st
2016-03-23 16:06:29.881 xctest[72805:4013708] building set: {(
"public.utf8-plain-text",
"public.data"
)}
2016-03-23 16:06:29.881 xctest[72805:4013708] type: public.utf8-plain-text, adding: (
"string data"
) to (
)
#!/usr/bin/env ruby -W
# encoding: utf-8
require 'set'
pattern = ARGV.shift
exit 1 if pattern.nil?
root_pattern = File.join(Dir.getwd, '**', pattern)
#!/usr/bin/ruby
class String
# Renvoie la première lettre d'une chaine
def head
nil
self[0].chr unless self.empty?
end
# Renvoie la chaîne moins son premier caractère