Skip to content

Instantly share code, notes, and snippets.

@gorosz
gorosz / input_replace
Last active December 22, 2015 17:19
[javascript] - input_replace
<script>
$('#urlinput').attr('readonly', 'readonly');
jQuery('input[id=nameinput]').each(function(){
$(this).keyup(function(){
var x = $(this).closest("form").find('#urlinput');
//alert(x);
var y = $(this);
jQuery(x).val(jQuery(y).val().replace(/[&;,.() *-]/g, '_').replace(/[öóő]/g, 'o').replace(/[üúű]/g, 'u').replace(/[á]/g, "a").replace(/[é]/g, "e"));
@gorosz
gorosz / delete_dialoge
Created September 10, 2013 06:09
[javascript] - delete_dialoge
<script>
function DeleteComment(server, app, f, attrid) {
var args = Array.prototype.slice.call(arguments, 0);
args.unshift("http:/")
Url = args.join("/");
//alert(Url);
$( "#dialog-confirm" ).dialog({
resizable: false,
height:320,
width: 320,
@gorosz
gorosz / modal_with_load
Created September 5, 2013 11:09
[web2py] - modal_with_load
A(I(_class="icon icon-edit"), _href=URL('default', 'edit', args=["wbs", item['wbs_list']['id']]), _class="btn btn-mini btn-info", cid="remoteformbody", **{'_data-toggle': 'modal', '_data-target': '#RemoteModal', '_data-replace': 'true'})
@gorosz
gorosz / language_selector
Created June 21, 2013 16:49
[web2py] - language_selector
modell
======
if session.language:
T.force(session.language)
controller
==========
def set_lang():
l = request.vars.lang
session.language = l
@gorosz
gorosz / awk_convertkbmb
Created April 23, 2013 12:06
[awk] - convertkbmb
ls -l | awk '{print $5}' | awk '{ foo = $1 / 1024 / 1024 ; print foo "MB" }'
@gorosz
gorosz / travelling_calculation
Last active December 16, 2015 09:19
[javascript] - travelling_calculation
<script>
$(document).ready(function() {
$("#traveling_napidij_napok_szama").click(function(){
$(this).css('background-color', 'white').css('color', 'black');
});
$(".sumvaluta").each(function() {
$(this).attr('disabled','disabled');
});