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
Command Line Parameters of Openmodelica (1.9.1) generated Simulation Binaries | |
<-abortSlowSimulation> | |
aborts if the simulation chatters | |
<-alarm=value> or <-alarm value> | |
aborts after the given number of seconds (0 disables) |
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
# i claim no copyright on this code and place it in the public domain. | |
# do whatever you want with this code... | |
import argparse | |
parser = argparse.ArgumentParser(description='show differences of two views') | |
o = parser.add_argument | |
o('files', type=str, help='files to process', nargs='+') | |
#o('-b', '--boolarg', action='store_true', help="") | |
#o('-s', '--strarg', help="") | |
args = parser.parse_args() |
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
-- my previous phone miss-synced all my birthday entries to wrong dates | |
-- the first requirement to fix this is to have a white | |
-- canvas again. So removing all birthdays and ask people | |
-- and facebook for adding them again... | |
tell application "Contacts" | |
set peopleToChange to people | |
repeat with thePerson in peopleToChange | |
set the birth date of thePerson to missing value | |
end repeat |
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
You can create a loading page and render the actual app after the web server has started. | |
The loading page (loading.html) will load a js file that launches your actual application page as a hidden window and you can then show it when the server is running. | |
<script> | |
var currentWindow = gui.Window.get(); // Get reference to loading.html | |
var exec = require('child_process').execFile; | |
exec('home.py', {cwd:'.'}, function (error, stdout, stderr){ // Runs your python code | |
var appWindow = gui.Window.open('app.html', // Starts your application |
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
// Example of an array with links | |
tinymce.init({ | |
plugins: "link", | |
link_list: [ | |
{title: 'My page 1', value: 'http://www.tinymce.com'}, | |
{title: 'My page 2', value: 'http://www.moxiecode.com'} | |
] | |
}); |
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
<!doctype html> | |
<title>Path: {{ tree.name }}</title> | |
<h1>{{ tree.name }}</h1> | |
<ul> | |
{%- for item in tree.children recursive %} | |
<li>{{ item.name }} | |
{%- if item.children -%} | |
<ul>{{ loop(item.children) }}</ul> | |
{%- endif %}</li> | |
{%- endfor %} |
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
tinymce.init({ | |
file_browser_callback: function(field_name, url, type, win) { | |
tinymce.activeEditor.windowManager.open({ | |
title: "My file browser", | |
url: "myfilebrowser.html", | |
width: 800, | |
height: 600 | |
}, { | |
oninsert: function(url) { | |
win.document.getElementById(field_name).value = url; |
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
#define List(o) \ | |
o(1,2) \ | |
o(2,3) \ | |
#define MAP_CALL_FN_PARENS(...) (__VA_ARGS__); | |
#define MAP_CALL_FN(fn) fn MAP_CALL_FN_PARENS | |
#define MAP(list, fn, ...) list(MAP_CALL_FN(fn)) |
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 flask import Flask, request, send_from_directory | |
# set the project root directory as the static folder, you can set others. | |
app = Flask(__name__, static_url_path='') | |
@app.route('/js/<path:path>') | |
def send_js(path): | |
return send_from_directory('js', path) | |
if __name__ == "__main__": |
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
function fuzzy_match(text, search) | |
{ | |
/* | |
Parameter text is a title, search is the user's search | |
*/ | |
// remove spaces, lower case the search so the search | |
// is case insensitive | |
var search = search.replace(/\ /g, '').toLowerCase(); | |
var tokens = []; | |
var search_position = 0; |
NewerOlder