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
From c7beb5c57d51c33747c0d1331ef25787a24779be Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Pawe=C5=82=20Wilk?= <[email protected]> | |
Date: Fri, 19 Apr 2024 14:52:00 +0200 | |
Subject: [PATCH] CCACHE-66: Improved equality checks for keywords | |
--- | |
src/main/clojure/clojure/core/cache.clj | 6 +++--- | |
src/main/clojure/clojure/core/cache/wrapped.clj | 2 +- | |
2 files changed, 4 insertions(+), 4 deletions(-) |
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
#include <string.h> | |
#undef streq | |
#ifndef STREQ | |
# define STREQ streq | |
#endif | |
int | |
STREQ (const char *p1, const char *p2) |
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
(defn outof | |
([] []) | |
([of] of) | |
([of what] | |
(if (instance? clojure.lang.IEditableCollection of) | |
(with-meta (persistent! (reduce disj! (transient of) what)) (meta of)) | |
(reduce disj of what))) | |
([of xform what] | |
(if (instance? clojure.lang.IEditableCollection of) | |
(with-meta (persistent! (transduce xform disj! (transient of) what)) (meta of)) |
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
(defrecord XError [reason message response]) | |
(def default-messages | |
{:blabla "This is blabla" | |
:unknown "Unknown error" | |
:empty "Empty response"}) | |
(defn new-error | |
"Forms an error response when something goes wrong." | |
([reason response] |
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
(require 'eneltron.tokens) | |
(eneltron.tokens/initialize-tokenizer) | |
(def tekst "Siała baba mak. Nie wiedziała jak. Raz, dwa – oraz – 4.") | |
(time (def wynik (eneltron.tokens/tokenize tekst))) | |
; => "Elapsed time: 0.230337 msecs" | |
(apply print | |
(map #(str (apply str (next (str (:token-class (meta %1))))) " ->" \tab \tab (apply str %1) \newline) |
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
<?php | |
function mytheme_alpha_preprocess_node(&$vars) { | |
$node = $vars['node']; | |
if (isset($vars['field_topic'][0]['tid'])) { | |
$parents = taxonomy_get_parents($vars['field_topic'][0]['tid']); | |
$top_parent = array_shift($parents); | |
$vars['topic'] = field_view_value('node', $node, 'field_topic', array( | |
'tid' => $top_parent->tid, 'label' => 'hidden')); |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); |
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
# Enabling order for Radiant extensions migration. | |
# | |
# ------------------------------------------------- | |
# Modify environment.rb by putting this AFTER the line with 'config.extensions': | |
if ENV.has_key?('CONFIG_EXTENSIONS') | |
::PENDING_EXTENSIONS = config.extensions.clone | |
config.extensions = ENV['CONFIG_EXTENSIONS'].split(/[\,\ \:]+/).map{ |x| x.strip.to_sym } | |
end |
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
def self.attr_inheritable(*variables) | |
variables.each do |v| | |
module_eval %{ | |
def self.#{v} | |
@#{v} = superclass.#{v} if !instance_variable_defined?(:@#{v}) && superclass.respond_to?(:#{v}) | |
return @#{v} | |
end | |
} | |
end | |
end |
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
# Author:: Paweł Wilk (mailto:[email protected]) | |
# Copyright:: Copyright (c) 2009 Paweł Wilk | |
# License:: LGPL | |
# | |
# This module is intended to be used as extension | |
# (class level mixin) for classes using some buffers | |
# that may be altered by calling certain methods. | |
# | |
# It automates resetting of buffers by installing |
NewerOlder