Skip to content

Instantly share code, notes, and snippets.

View jtomasek's full-sized avatar

Jiri Tomasek jtomasek

  • SUSE
  • Usti nad Orlici, Czech Republic
View GitHub Profile
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 ActionScript
drwxrwxr-x. 3 jtomasek jtomasek 4096 Feb 23 12:44 Alignment
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 AppleScript
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 ASP
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 Batch File
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 C#
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 C++
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 Clojure
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 23 11:17 Color Scheme - Default
drwxrwxr-x. 2 jtomasek jtomasek 4096 Feb 22 09:23 CSS
@jtomasek
jtomasek / gist:5189239
Created March 18, 2013 17:49
Javascript translations
Javascript translations:
base requirement:
- have no hardcoded strings in javascript
general aproach:
- have strings defined in view file (html/erb/haml...) in data attribute, this enables their translation
- access these translated strings from javascript
angular directive approach:
- we need to translate strings used in directive templates
<mhulan> hi, anyone experienced "Asset logical path has no extension: alchemy/jquery/plugins/flot-0.7/Makefile" when running rake assets:precompile? any idea what may be wrong?
<jtomasek> it seems like asset can't be file without extension, is removing Makefile valid solution for you? By googling I found some filed issues in sprockets, not sure if it has been resolved
<jtomasek> mhulan: ^
<mhulan> jtomasek: thx, just found similar comments via google, I use alchemy as 3rd party gem and got this when running precompilation during rpm build, I'll try newer version of sprockets first
<jcoufal> mhulan: hey, just wondering in what project are you using alchemy?
<mhulan> currently something called Signo (SSO for Katello and Foreman)
<jcoufal> mhulan: is that some new RH project?
<mhulan> jcoufal: no no, it's just one small support application for Katello
<jcoufal> mhulan: ah, alright, cool, if you need anything, we will do our best to help you
<mhulan> well I just updated sprockets to 2.9.0 and still same problem,
<jtomasek> ping, ehelms, hi, mhulan had a problem regarding asset precompilation during rpm build here is the conversation: https://gist.github.com/jtomasek/5255206
<ehelms> jtomasek: hrmm, I never got that anytime I tried to asset precompile, I'd have to see, I think, what his asset precompile path is
<ehelms> jtomasek: did he leave for the day already?
<jtomasek> ehelms: yes it seems so unfortunatelly
<jtomasek> obviously the error is caused by Makefile not having a extension. but it is strange that it only happens in rpmbuild and not when he runs it on localhost. The issue might be fedora gem (sprockets) used when rpm is bult maybe?
<ehelms> hrmm, could be, I haven't tried to build an RPM with asset pipeline yet I don't think, but if it's trying to compile the Makefile
<ehelms> that tels me his pathing is pointing at the engine's directories somehow
<ehelms> instead of just the main app's manifests
<ehelms> which should grab the specific JS files
<ehelms> that's my inclination at least
fedora18vm: ~/alchemy-tables [git:master]
→ grunt test
Running "test" task
Running "clean:server" (clean) task
Cleaning ".tmp"...OK
Running "compass:dist" (compass) task
WARNING: 'logo.png' was not found (or cannot be read) in /home/jtomasek/alchemy-tables/app/images/embed
WARNING: 'spinner_head.gif' was not found (or cannot be read) in /home/jtomasek/alchemy-tables/app/images/alchemy/icons
pdf_head_html = "<head>"
pdf_head_html << '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
pdf_head_html << "<%= javascript_include_tag 'jquery/jquery-1.8.3.min' %>"
pdf_head_html << "<%= javascript_include_tag 'wkhtmltopdf.tablesplit' %>"
# pdf_head_html << "<%= stylesheet_include_tag 'print' %>"
# pdf_head_html << '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>'
# pdf_head_html << '<script type="text/javascript" src="/javascripts/wkhtmltopdf.tablesplit.js"></script>'
pdf_head_html << "</head>"
@jtomasek
jtomasek / gist:5531292
Last active December 17, 2015 01:49
devstack/localrc
# sample for this file is in samples/localrc
# http://fedoraproject.org/wiki/OpenStack_devstack
# http://devstack.org/localrc.html
DEST=$HOME/src/openstack
DATA_DIR=$DEST/data
LOGFILE=$DATA_DIR/logs/stack.log
SCREEN_LOGDIR=$DATA_DIR/logs
VERBOSE=False
@jtomasek
jtomasek / gist:6029221
Created July 18, 2013 13:17
./run_tests.sh
Successfully installed django-compressor django-openstack-auth iso8601 netaddr python-cinderclient python-glanceclient python-keystoneclient python-novaclient python-quantumclient python-swiftclient pytz python-tuskarclient lockfile django-appconf prettytable requests simplejson pyOpenSSL warlock six oslo.config cliff httplib2 pyparsing jsonschema jsonpatch cmd2 jsonpointer
Cleaning up...
Installing horizon module in development mode...
warning: no files found matching '*.css_t' under directory 'doc'
warning: no files found matching '*.csv' under directory 'horizon'
warning: no files found matching '*.template' under directory 'horizon'
warning: no files found matching '*.js' under directory 'openstack_dashboard'
warning: no files found matching 'AUTHORS'
warning: no files found matching 'ChangeLog'
warning: no previously-included files found matching 'openstack_dashboard/local/local_settings.py'
@jtomasek
jtomasek / gist:6087164
Created July 26, 2013 08:16
sample data mx_vms
diff --git a/tools/sample_data.py b/tools/sample_data.py
index 6298ca5..1f3c4c4 100644
--- a/tools/sample_data.py
+++ b/tools/sample_data.py
@@ -210,7 +210,8 @@ def generate_data():
dict(name='cpu', value='4', unit='count'),
dict(name='memory', value='15', unit='GB'),
dict(name='storage', value='1680', unit='GB'),
- ]),
+ ],
@jtomasek
jtomasek / gist:6088262
Created July 26, 2013 11:46
resource class capacities property
@property
def capacities(self):
if not hasattr(self, '_capacities'):
# racks = self.list_racks
capacities = [rack.capacities for rack in self.list_racks]
def add_capacities(c1, c2):
return [Capacity({'name': a.name,
'value': int(a.value) + int(b.value),
'unit': a.unit}) for a, b in zip(c1, c2)]