This file contains hidden or 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/dat.h b/dat.h | |
index 2570e76..ac6f6e7 100644 | |
--- a/dat.h | |
+++ b/dat.h | |
@@ -204,6 +204,9 @@ void job_free(job j); | |
/* Lookup a job by job ID */ | |
job job_find(uint64 job_id); | |
+/* Lookup oldest job */ | |
+job job_oldest(); |
This file contains hidden or 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
<% | |
# Generate lookup Hash of fingerprinted filenames for html templates | |
# Leave regexp open ended to include preprocessed templates (.erb, etc.) | |
template_regexp = /(?:\/assets\/templates\/)(.*\.html)/ | |
template_files = Rails.application.assets.each_file.to_a.join("\n").scan(template_regexp).flatten | |
templates = Hash[template_files.map {|file| [file, asset_url(file)] }] | |
%> | |
var fingerprintedTemplates = angular.module('services.fingerprintedTemplates', []); | |
fingerprintedTemplates.factory('fingerprintedTemplates', [ |
This file contains hidden or 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
class Feline | |
class_attribute :meow | |
self.meow = '<feline-silence/>' | |
def self.meow | |
raise NotImplementedError | |
end | |
end | |
class MetaCat < Feline |
This file contains hidden or 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
// Requires angular-mock | |
describe('$templateCache service', function() { | |
var service, | |
httpBackend, | |
template = "<div>test</div>", | |
templateResponse = '<script id="test" type="text/ng-template">' + template + '</script>'; | |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: acpi_wakeup | |
# Required-Start: $remote_fs $syslog $all | |
# Required-Stop: 0 6 | |
# Default-Start: 1 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Disable acpi wakeup for given devices | |
### END INIT INFO |
This file contains hidden or 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
Module Size Used by | |
btusb 32412 0 | |
snd_hda_codec_hdmi 46207 1 | |
snd_hda_codec_realtek 61438 1 | |
hid_sensor_accel_3d 13221 0 | |
hid_sensor_als 13123 0 | |
hid_sensor_magn_3d 13209 0 | |
hid_sensor_gyro_3d 13209 0 | |
hid_sensor_trigger 12916 4 hid_sensor_gyro_3d,hid_sensor_accel_3d,hid_sensor_als,hid_sensor_magn_3d | |
joydev 17381 0 |
This file contains hidden or 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
module Concerns | |
module Mocha | |
module CallsThrough | |
def calls_through | |
method_name = @method_matcher.expected_method_name | |
@mock.instance_variable_get(:@receiver) | |
@original_method = @mock.instance_variable_get(:@mockery).stubba.stubba_methods.find do |mockery| | |
mockery.method == method_name | |
end.instance_variable_get(:@original_method) | |
self |
This file contains hidden or 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
module LexicalScope | |
SCOPED_CONSTANT = [:lexical_scope].freeze | |
def scoped_value | |
value = defined?(super) ? super.dup : [] | |
value.concat(SCOPED_CONSTANT) | |
end | |
end | |
module IsWeird |
This file contains hidden or 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
require 'benchmark/ips' | |
number = "731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749303589072962904915604407723907138105158593079608667017242712188399879790879227492190169972088809377665727333001053367881220235421809751254540594752243525849077116705560136048395864467063244157221553975369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474821663704844031998900088952434506585412275886668811642717147992444292823086346567481391912316282458617866458359124566529476545682848912883142607690042242190226710556263211111093705442175069416589604080719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606058861164671094050775410022569831552000559357297257163626956188267042825248360082325753042 |
This file contains hidden or 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
# Project Euler #8 - Largest product in a series | |
# https://projecteuler.net/problem=8 | |
# | |
# Find the thirteen adjacent digits in the 1000-digit number that have the | |
# greatest product. What is the value of this product? | |
def largest_product_in_series(series, adjacency_length = 13) | |
factors = [] | |
largest_product = 0 | |
current_product = 1 |
OlderNewer