Skip to content

Instantly share code, notes, and snippets.

View meeDamian's full-sized avatar
👨‍💻
Lightning Networking

Damian Mee meeDamian

👨‍💻
Lightning Networking
View GitHub Profile
@meeDamian
meeDamian / progranizm-2.5.1.c
Created September 18, 2011 16:48
[ C | pure_awesome ] Realisation of genetic algorythm
// Progranism Source Code: Version 2.5.1
// This new version of Progranisms should handle restrictive environments better
// It implements a better method of seeding the random number generator
// Returning to asexual behavior
// 2.5.1: Modified mutation selection code
// This is Linux code and should not compile under Windows
#include <sys/time.h>
#include <stdio.h>
def a(x=4):
if(x<=len(input("Podaj imie: "))<=x**2): print("poprawne imie")
else: a()
a()
@meeDamian
meeDamian / do_przetlumaczenia.sql
Created September 21, 2011 11:09
tabela zawierajaca wszystkie polskie fragmenty
INSERT INTO base_fragments_pl
(name,content,priority)
VALUES
('appName' ,'Tytuł aplikacji',0),
('appDescription' ,'Długi opis aplikacji, którego i tak, prawdopodobnie nikt nie czyta',0),
('appRule' ,'Pierwsza i najważniejsza zasada',0),
('appRule' ,'Druga już zupełnie nie potrzebna zasada',1),
('appRule' ,'Trzecia zasada...',2),
-- zasad może być do oporu
('appDefaultContent','Domyślne wypęłnienie treści w nowo dodawanym poście',0),
@meeDamian
meeDamian / element_template.html
Created September 28, 2011 13:03
One element template
<div class="element" style="max-width: 33%;">
<div class="element_pic">
<img src="" alt="here cames da picture!" />
<div class="element_screens element_more">
<img src="" alt="thumb1" />
<img src="" alt="thumb1" />
<img src="" alt="thumb1" />
<img src="" alt="thumb1" />
</div>
</div>
@meeDamian
meeDamian / menu.html
Created September 30, 2011 10:11
oto menu, gdzie dodać tego selecta ?
<div id="top_menu">
<ul id="navigator">
<li class="menu_main menu_selected">
<a class="menu_main_caption menu_selected">ELEMENTS</a>
<ul class="submenu">
<li class="menu_contests">
<a href="#elements" id="menu_elements" class="submenu_selected">List of elements</a>
<li class="menu_contests">
<a href="#generator" id="menu_generator">General Settings</a>
</li>
@meeDamian
meeDamian / gist:1277606
Created October 11, 2011 08:52
Calculating nth fibbonacci element
def nth_fib( n ):
# actual actions;
# obliczanie n-tego elementu ciągu fibonnaciego
print(nth_element,sum_of_dividors,SEP="\n")
<fieldset id="the_list">
<p id="company_name">AAAAAA</p>
<form action="index.php" method="post" id="company_form">
<input type="hidden" name="company_id" id="company_id" value="##" />
<input type="submit" name="action" value="rename_company" />
</form>
<ul id="page_list">
<li class="group_node">
<p class="group_name">BBBBBB</p>
<form action="index.php" method="post" class="group_form">
@meeDamian
meeDamian / ajax_respond.php
Created October 27, 2011 19:17
[ PHP | lib ] respond from AJAX request
<?
// remember to set proper headers!
/**
* RESPOND WITH VALID JSON STRING (FROM AJAX)
* it's more of a standard than a particular function =) .
* descriptions for below parameters are RECOMMENDED usage, each one of them can be of any type
**
* $success (bool) => if AJAX operation succeded
* $cause (string) => very quick explanation: "<type> <operation> <operation parameter>"
* $more (array) => if more info occured, here's the place to return it
<?
/**
* LOGGING FUNCTION
**
* $str => string to be logged
* $type => type of logging:
* - access: all non-error ACTIONS generated by users
* - user : same as 'access'
* - error : all possible ERRORS generated by users
* - admin : all important access/error actions generated by ADMIN
<div id="coupon">
<div id="user_data">
<img id="user_pic" src="<?="cache/avatars/avatar_".$fid.".jpg";?>">
<p id="user_name"><?=$name;?>, oto kupon rabatowy dla Ciebie:</p>
</div>
<a id="coupon_printable" href="<?=$url['print']."?promotion_id=".$promotion_id."&code=".$coupon_id."&fid=".$fid;?>" target="new">
<img src="<?=$coupon_url;?>" alt="coupon" />
</a>