{{ message }}

Instantly share code, notes, and snippets.

# Chris Lundquist ChrisLundquist

Last active Jun 10, 2018
euler 35.rb
View euler35.rb
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/env ruby # The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. # There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. #How many circular primes are there below one million? # require 'prime' candidates = [2] + Prime.each(1_000_000).reject { |p| p.digits.any? { |d| d.even? } } def siblings(int)
Created Apr 17, 2018 — forked from loderunner/fs_capabilities.m
View fs_capabilities.m
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
 // // fs_capabilities.m // // Created by Charles Francoise on 13/05/14. // Copyright (c) 2014 Charles Francoise. All rights reserved. // #include #include #include
Created Apr 17, 2018 — forked from loderunner/fs_capabilities.m
View fs_capabilities.m
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
 // // fs_capabilities.m // // Created by Charles Francoise on 13/05/14. // Copyright (c) 2014 Charles Francoise. All rights reserved. // #include #include #include
Created Aug 27, 2017
Two Sum
View two-sum.rb
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/env ruby def find_pair!(data, target) # We know we won't use a value greater than our target data.reject! { |i| i > target } # Sort it so we don't have to scan our list a bunch data.sort! # If our two biggest numbers are lower than the target, we're boned
Last active Jul 20, 2016
tng json
View get_episodes.sh
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/env bash wget http://www.chakoteya.net/NextGen/{101..277}.htm
Last active Dec 9, 2015
View results.txt
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
 \$ ruby -v ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14] Rehearsal -------------------------------------------------------------- map_compact 0.020000 0.000000 0.020000 ( 0.015315) map_inplace_compact 0.010000 0.000000 0.010000 ( 0.016069) reject_map 0.010000 0.000000 0.010000 ( 0.014038) reject_inplace_map 0.860000 0.010000 0.870000 ( 0.860999) reject_map_inplace 0.010000 0.000000 0.010000 ( 0.013710) reject_inplace_map_inplace 0.860000 0.000000 0.860000 ( 0.866945)
Created Jun 10, 2015
View configure.ac.diff
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
 diff --git a/configure.ac b/configure.ac index f713ce1..94b986c 100644 --- a/configure.ac +++ b/configure.ac @@ -2552,8 +2552,8 @@ AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path with_libmongoc="no" else with_libmongoc="yes" - LIBMONGOC_CPPFLAGS="\$LIBMONGOC_CPPFLAGS -I\$withval/include" - LIBMONGOC_LDFLAGS="\$LIBMONGOC_LDFLAGS -L\$withval/lib"
Last active Oct 11, 2019
Recipes

Serves 4

• 1/4 cup white sugar
• 2 tablespoons fish sauce
• 2 tablespoons lime juice
• 2 tablespoon tamarind concentrate (mixed with 1/4 cup water)
• 1/2 (12 ounce) package dried rice noodles
• 1/4 cup vegetable oil
• 3/4 teaspoon minced garlic
• 2 eggs
Created Aug 17, 2014
Do you speak English?
View English.md

### Do you speak English?

There I was in Seattle, just walking out from one of my favorite coffee shops. As soon as I walk out, a stranger makes eye contact and asks a very simple question. Do you speak English?

I was a little confused by the question. People were speaking English all around him. Why did he ask me? I answered, "Yes".

He then proceeded to tell me a story about how he needs bus fare to get to Portland.

Last active Aug 29, 2015
View Build
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
 \$ gcc -Wall -Wextra -pedantic -std=c11 -O3 -S -march=corei7 main.c # Gives you the popcnt assembly, GCC knows we have the instruction \$ gcc -Wall -Wextra -pedantic -std=c11 -O3 -S main.c # Gives you the mask assembly