Skip to content

Instantly share code, notes, and snippets.

@silviot
silviot / gist:6794863
Created October 2, 2013 14:44
SublimeText import/export python script
#!/bin/env
"""
Import / export sublime config settings.
"""
import os
from subprocess import check_output
HOME_SUBL = os.path.expanduser("~/.config/sublime-text-3/Packages/User")
"""
Use with
bin/instance run export_skin_folder.py
This script will extract the portal_skins folder
named in SKINFODLER_NAME to the DEST directory
"""
import os
import sys
PLONE_PORTAL = 'Plone'
<plominodatabase id="multi">
<design>
<dbsettings version="1.16">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[<p><br mce_bogus="1"></p>]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[<p><br mce_bogus="1"></p>]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<StorageAttachments type="Products.Archetypes.Field.BooleanField">False</StorageAttachments>
Ext.define('RIP.LabeledSlider',{
/* A slider that shows its value next to it*/
extend: 'Ext.field.Slider',
xtype: 'labeledslider',
updateToolTip: function() {
this.valuediv.innerHTML = this.getValue();
},
reset: function() {
this.callParent(arguments);
this.updateToolTip();
"""
I have a challenge for you:
- Print "Hello World" using any language.
- Each character must be printed from its own, unique thread
That's it. Obviously, as there's no guarantee that the threads will operate in the order you start them, you have to make your program thread safe to ensure the output is printed in the right order.
And, because this is code golf, the shortest program wins.
Source: http://codegolf.stackexchange.com/questions/5871/helolw-rdlo-a-threading-challenge
@silviot
silviot / buildout-redmine.cfg
Created January 3, 2012 00:19
Redmine 1.3.0 installation buildout
[buildout]
parts =
rubygems
redmine
redmine-config
redmine-database
var
redmine-session-initialize
swap-data-dirs
@silviot
silviot / flextextarea.js
Created October 17, 2011 12:55
Ext.ux.FlexTextArea: textarea field that adjusts its height to fit the text in it
// Tested with ExtJS 3.2.0
Ext.ux.FlexTextArea = Ext.extend(Ext.form.TextArea, {
maxHeight : 300, // don't grow beyond this point
minHeight : 30, // don't shrink below this height
growBy: 20, // size the textarea to leave this space blank
initComponent : function() {
Ext.ux.FlexTextArea.superclass.initComponent.call(this);
if (!this.rendered) {
this.addListener('render', this.createHelperElement, this);
} else {