Skip to content

Instantly share code, notes, and snippets.

@JozefResetar
JozefResetar / index.js
Created May 14, 2018 14:42
react-native simple app
import React, { Component } from 'react';
import { Text, AppRegistry, View } from 'react-native';
import axios from 'axios';
const App = () => {
return (
<View>
<Header headerText={"Albums"} />
<AlbumList />
</View>
@JozefResetar
JozefResetar / gen_v_curly_exps.py
Created November 10, 2017 11:56
generate valid curly brackets expression with unit test
import random
import sys
import unittest
def gen_rand_curly_brackets_expression(length):
expression = []
stack = []
first = True
while length > 0:
if len(stack) == 0:
first = True
@JozefResetar
JozefResetar / kb_article.rb
Created September 26, 2012 05:11
global search kb
class KbArticle < ActiveRecord::Base
unloadable
scope :visible, lambda {{ :include => :category }}
self.table_name = "kb_articles"
validates_presence_of :title, :category
validates_presence_of :category_id
belongs_to :project # XXX association added to allow searching to work
belongs_to :category, :class_name => "KbCategory"
@JozefResetar
JozefResetar / global-search.patch
Created September 25, 2012 11:04 — forked from alexbevi/global-search.patch
Redmine + Knowledgebase Patches for Global Search (proposed)
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index 6bae37b..8057da6 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -83,7 +83,7 @@ class ArticlesController < KnowledgebaseController
end
def tagged
- @tag = params[:id]
+ @tag = params[:article_id] || params[:id]