This file contains hidden or 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
| def rand_str length | |
| ('a'..'z').to_a.shuffle[0..length].join | |
| end |
This file contains hidden or 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
| def timestamp | |
| Time.now.to_i | |
| end |
This file contains hidden or 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
| public class Dice { | |
| private int anzahl; | |
| private int grenze = 6; | |
| private int[] zaehler = new int[6]; | |
| Dice(int wuerfeAnzahl){ | |
| anzahl = wuerfeAnzahl; | |
This file contains hidden or 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
| public class Arrays { | |
| public static void main(String[] args) { | |
| int[] numbers = new int[5]; | |
| numbers[0] = 5; | |
| int l = numbers.length; |
This file contains hidden or 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
| <% request.header do |k, v| %> | |
| "<%= k %>" => <%= v %><br> | |
| <% end %> | |
| <% for header in request.env.select {|k,v| k.match("^HTTP.*")} %> | |
| "<%=header[0].split('_',2)[1]%>" => <%=header[1]%><br> | |
| <% end %> |
This file contains hidden or 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
| <?php | |
| function random_string($length) { | |
| $LETTERS = 'abcdefghijklmnopqrstuvwxyz'; | |
| $random_string = ''; | |
| for ($i=0; $i < $length; $i++) { | |
| $random_string = $random_string.$LETTERS[rand(0, strlen($LETTERS)-1)]; | |
| } |
NewerOlder