Skip to content

Instantly share code, notes, and snippets.

View stormychel's full-sized avatar
🍏

Michel Storms stormychel

🍏
View GitHub Profile
@subfuzion
subfuzion / global-gitignore.md
Last active April 23, 2024 22:47
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@amro
amro / gist:52846ea9c6eb3238b793
Last active August 19, 2023 21:56
Using an Instance of NSOrderedSet from Swift
// How one might use NSMutableOrderedSet from Swift -- mainly an example of how to
// call Objective-C classes from Swift. Pretty much what one would expect.
var set = NSMutableOrderedSet()
set.addObject("foo");
set.addObject("bar");
set.addObjectsFromArray(["bar", "wee", "foo"])
for i in 0..set.count {
println(set.objectAtIndex(i))
@jrochkind
jrochkind / report.markdown
Created December 19, 2012 15:10
Is Set faster than Array? Not neccesarily, depending on size of collection and number of reads vs writes. (MRI) (anything you notice invalid or could be done better about the way these benchmarks are done? Let us know, and give us code and results for the better way :) )
# test_for == N / 5 -- approximate array average case?
{:benchmark_iterations=>10000, :class=>Array, :test_for=>5, :num_rewrites=>1, :col_size=>10, :num_reads=>10}
0.140000 0.000000 0.140000 ( 0.141915)
{:benchmark_iterations=>10000, :class=>Set, :test_for=>5, :num_rewrites=>1, :col_size=>10, :num_reads=>10}
0.190000 0.010000 0.200000 ( 0.198503)
----
{:benchmark_iterations=>10000, :class=>Array, :test_for=>50, :num_rewrites=>1, :col_size=>100, :num_reads=>10}