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
| You are ChatGPT, a large language model based on the GPT-5 model and trained by OpenAI. | |
| Knowledge cutoff: 2024-06 | |
| Current date: 2025-08-08 | |
| Image input capabilities: Enabled | |
| Personality: v2 | |
| Do not reproduce song lyrics or any other copyrighted material, even if asked. | |
| You're an insightful, encouraging assistant who combines meticulous clarity with genuine enthusiasm and gentle humor. | |
| Supportive thoroughness: Patiently explain complex topics clearly and comprehensively. | |
| Lighthearted interactions: Maintain friendly tone with subtle humor and warmth. |
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
| pyg = 'ay' | |
| original = raw_input('Enter a word:') | |
| if len(original) > 0 and original.isalpha(): | |
| word = original.lower() | |
| first = word[0] | |
| if first == "a" or "e" or "i" or "o" or "u": | |
| print "vowel" | |
| else: |
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
| import Data.List | |
| import Data.Tree | |
| combinationsTree xs = unfoldTree next ([], xs) | |
| where next (path, xs) = (path, map (appendTo path . splitAt 1) $ init $ tails xs) | |
| appendTo path (x, ys) = (path ++ x, ys) | |
| depth 0 node = Node{rootLabel=(rootLabel node), subForest=[]} | |
| depth n node = node{subForest=(map (depth (n - 1)) (subForest node))} |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
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
| jQuery.cleanData = _.wrap jQuery.cleanData, (cleanData, elems) -> | |
| for elem in elems | |
| $(elem).data('view')?.dispose() | |
| cleanData.apply @, arguments |
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
| from sys import argv, exit | |
| from random import choice | |
| from string import ascii_letters, digits | |
| if len(argv) < 2: | |
| print "usage: %s length [quantity]" % (argv[0]) | |
| exit(1) | |
| length, quantity = int(argv[1]), 1 | |
| if len(argv) == 3: |
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
| from sys import argv, exit | |
| types = { | |
| 'simple': lambda capital, rate, time: capital * (1 + (rate * time)), | |
| 'compound': lambda capital, rate, time: capital * ((1 + rate) ** time) | |
| } | |
| if len(argv) != 5 or argv[1] not in types: | |
| print "usage: %s <%s> capital rate time" % (argv[0], '|'.join(types)) | |
| exit(1) |
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
| #!/usr/bin/env python | |
| lower, upper = 1, 100 | |
| print "Guess a number between %s and %s (inclusive)." % (lower, upper) | |
| while lower < upper: | |
| mid = (lower + upper) / 2 | |
| guess = raw_input("Is your number higher than %s? (y/n): " % (mid)) | |
| if guess == 'y': |
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
| #!/usr/bin/env python | |
| from string import printable, maketrans | |
| from random import seed, shuffle | |
| def cipher_alphabet(key): | |
| alphabet = [c for c in printable] | |
| seed(hash(key)) | |
| shuffle(alphabet) | |
| return ''.join(alphabet) |
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
| caesar_encode = caesar_decode = lambda m: m.encode('rot13') |
NewerOlder