Skip to content

Instantly share code, notes, and snippets.

puts "ingilizce alfabeyi kullanarak cumlenizi giriniz".tr "A-Za-z", "N-ZA-Mn-za-m"
@roktas
roktas / she.sh
Last active August 29, 2015 13:56
#!/bin/bash
case $BASH_VERSION in
[4-9]*)
;;
*)
echo >&2 "Bash version 4 or higher required."
exit 1
esac
#!/bin/bash
# Hold some packages for safe upgrades
dpkg -l linux-{image,headers}'*' grub'*' |
awk '/^ii/ { print $2 " " "hold" }' |
dpkg --set-selections

Bu program iki sayının büyüğünü görüntüler. Denemek için:

$ make
$ ./max 19 27
@roktas
roktas / t.rb
Last active August 29, 2015 13:58
# encoding: utf-8
class A
attr :x
@count = 0
def initialize(verilen)
@x = verilen
A.count += 1
@roktas
roktas / freq.sh
Last active August 29, 2015 13:58
Read a file of text, determine the n most frequently used words, and print out a sorted list of those words along with their frequencies.
#!/bin/sh
# http://franklinchen.com/blog/2011/12/08/revisiting-knuth-and-mcilroys-word-count-programs/
# http://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692
tr -cs A-Za-z '\n' |
tr A-Z a-z |
sort |
uniq -c |
sort -rn |
sed ${1}q
getch() {
local saved=$(stty --save)
stty raw -echo
eval $1=$(dd bs=1 count=1 2> /dev/null)
local status=$?
stty $saved
return $status
}
getch() {
@roktas
roktas / h
Created April 14, 2014 21:42
#!/bin/bash
printf "\r\r\r"
echo
echo -en "\e[36;01m"
echo ' ____'
echo ' /\ \'
echo '/ \___\'
echo '\ / /'
echo -n ' \/___/'
@roktas
roktas / n
Created April 15, 2014 18:44
#!/bin/bash
# Bash, Zsh, Ksh compatible
dotunderscore_logo() {
local dotfront=$'\e[36;01m'
local dotback=$'\e[1;30m'
local underscorefront=$'\e[33;01m'
local underscoreback=$'\e[1;30m'
local reset=$'\e[0m'
#!/usr/bin/ruby
# Ascii logo for the forthcoming Dotunderscore
require 'erb'
require 'ostruct'
require 'term/ansicolor'
# Object core extensions from ActiveSupport
class Object #:nodoc: