This is a tutorial to help first-time contributors participate in a simple and easy project. Get more comfortable using GitHub and make your first open source contribution. It's quick and easy.
Learn how to contributeContributions so far...
 CS student trying explore Open-source community and add some value in it from my side.
3 Useful Dev Resources
K S Sai Teja
@saitej8262 KSSAITEJA K S SAI TEJA
I'm a dynamic full-stack developer, skilled in both front-end and back-end technologies, proficiently crafting comprehensive web applications from start to finish.
3 Useful Dev Resources
Jessica Mansell
Jessica Mansell Jessica-Mansell
I'm Jessica Mansell, a Harvard Student studying Social Sciences while learning how to code in my spare time and trying to break into mobile development.
3 Useful Dev Resources
Ankit Suman
A passionate Web Developer actively looking for opportunitites.
3 Useful Dev Resources
Murilo Oyafuso
Embedded Software Engineer from Brazil. This is my first contribution in open-source projects.
Brendan Freeman
A new Front End Web Developer, enjoying this new world.
3 Useful Dev Resources
Boppa Sri Satya Sai Hruday
I am a passionate developer from India. I found Open-Source intersting. So I want to contribute to it.
3 Useful Dev Resources
Mr.Ömer Yusuf
Yusuf Mr.Osmanoğlu OmerYusufProgCoding
A ambitious developer from Turkey who wants to go another country just beacuse of economy and the reason of economy ı think you know it
3 Useful Dev Resources
Anil Thakur
A passionate developer from India!!!
3 Useful Dev Resources
Abhi Joshi
Hi! I am currently transitioning from recruitment into tech space, and I am really excited. I am a Google Certified UX Designer, and looking to become a front-end developer, so I can pivot into the industry, and grow my career. I really enjoy reading, listening to music, and watching movies on my laptop. I am excited to be a part of this community who are all looking to learn, grow, and contribute to technology.
3 Useful Dev Resources
MD.Rubayet Hasan aka MR-Prey3r
MR-Prey3r Don't have a linkedin yet
AssalamuAlaikum(Peace be upon you) everyone! I'm MD.Rubayet Hasan, a tech passionate boy from Bangladesh. I love technologies and I've been learning web development as well as web security assessment & penetration testing. Currently Im focusing on bug bounty hunting & open-source contribution to get the real world work experience.
3 Useful Dev Resources
João Guilherme Camarota
Hi! I'm a brasilian huy who likes to play guitar and is always trying to learn new things. I am a Computer Engineering student at UFG and an IT Technician Intern at the Legislative Assembly of Goiás and i'm currently learning how to contribute in open source projects.
3 Useful Dev Resources
arnyagrwl
Student learning how to code. Mainly web development but I would like to expand my knowlegde to other fields as well.
3 Useful Dev Resources
Leonardo Basso
Software Developer with more than 2 years of experience, majoring in Computer Science at the Federal University of Lavras, I am versed in web technologies such as JavaScript, React, C# and .NET, used to design excellent solutions. My leadership and communication skills, combined with previous experiences, reinforce my adaptability, dexterity and versatility in solving challenges. In addition to the professional field, I have passions for playing football with friends, exploring financial markets and online gaming moments. I am open to new contacts<EMAIL_ADDRESS>3 Useful Dev Resources
Jeremiah Brandenstein
jeremiah-brandenstein JeremiahKC
12 years in the USAF. Degree in software development. I currently a test engineer.
3 Useful Dev Resources
Habeeb Kareem
Habeeb Kareem itskhabib bL34cHig0
Aspiring cybersecurity professional with a background in IT, currently focusing on learning Python for automation & penetration testing, while also making my first open-source contribution.
3 Useful Dev Resources
Navin Yadav
I am Exploring the Open source contribution
3 Useful Dev Resources
Erika Liu
I am a software engineer based in Dallas. This is my first contribution in open-source community.
3 Useful Dev Resources
Shubham Baghel
Self Taught Fullstack Developer (MERN )| React | Node js| JavaScript Enthusiast |AWS | MongoDB | SQL | Python|Machine learning
3 Useful Dev Resources
Jacques Blaauw
I am an Information Technology student studying at NWU South Africa
3 Useful Dev Resources
Aaqib Javaid
Passionate about crafting beautiful and functional web experiences. Love open source.
3 Useful Dev Resources
Omanshu
I a high school programming enthusiast interested in Machine Learning, Game Development and App Development
3 Useful Dev Resources
Psage001
I have a heart for adventure and i love the outdoors and learning coding
3 Useful Dev Resources
Deepak Shukla
deepak-shukla-320992249 Flames004
I'm an aspiring Full Stack Web Developer currently pursuing my Bachelors in Technology. Currently I'm learning React.js for enhancing my frontend along with Python for exploring AI and ML.
3 Useful Dev Resources
erik06
I'm a front-end web developer based in Chicago
3 Useful Dev Resources
Jevith
College freshman.As a passionate tech enthusiast, I'm constantly fascinated by the rapid advancements in the world of technology. From cutting-edge AI and robotics to the latest breakthroughs in augmented reality, I eagerly explore the endless possibilities that these innovations bring to our lives. Join me on this exhilarating journey as we delve into the exciting realm of technology together!
3 Useful Dev Resources
Raj Pulapakura
I'm an Aussie coder. I am passionate about deep learning and full stack development. I love building cool stuff.
3 Useful Dev Resources
Swathi
I'm a mother of 2 and was a full-stack developer. This is going to be my PR after a very long time and also this is my first GitHub contribution. I truly appreciate for coming up with this tutorial.
3 Useful Dev Resources
Super
Hello everyone! I'm currently a freshman in high school aspring to become a Software Engineer in the future! I'm currently learning and practicing Python, C++, and Machine Learning.
3 Useful Dev Resources
Ghosty
blackslashco blackslashcreative
I'm a Los Angeles based designer. developer. distruptor.
3 Useful Dev Resources
Paras Aggarwal
Heya!! I aspiring software Engineer, Who want to Create a impact in the world. Good Developers Copy, Great Developers Paste ~ A wise Man(May be)
3 Useful Dev Resources
Hamza Ali
A passionate full-stack developer working on tech stacks like MERN stack, React-Native, Django, Svelte who wants to code try to understand code help others in solving coding problems. My journey begins 1 year ago since then I have developed some real world solo projects in Django and MERN stack and more still to come. This is my first-contribution thanks for giving me a chance to become a member of this community.
3 Useful Dev Resources
Nevio Hirani
Hello, my name is Nevio and I am excited to be making my first contribution on GitHub. I am a dedicated programmer with a focus on Web, Mobile, and Game development. On my GitHub profile, you can find a collection of projects I have worked on, including mobile applications developed using SwiftUI. I began my programming journey two years ago and have been constantly improving since then. I find programming fascinating because it allows me to appreciate the effort and time that others put into creating websites and applications that we use every day. Thank you for allowing me to be a part of this community. - NH
3 Useful Dev Resources
Habibur Rahman
_habib7 habib33-3 habibur-rahman44
CSE Graduated and Open Source Enthusiast.
3 Useful Dev Resources
Vikas Chauhan
Learning to become an front-end developer, still learning new things everyday and trying to break into the Job market.
3 Useful Dev Resources
Edray Tuyor
IT Graduate | Eager to contribute to team success through hard work, attention to detail, time management, and dedication. I am prepared to listen, learn new skills, and improve my current skills. Motivated to complete tasks and projects for the purpose of growing and advancing in the Information Technology Industry. Technology.
3 Useful Dev Resources
Arun Kumar
Software Engineer
Binaya Batas
I am a highly motivated web developer with a strong foundation in modern web development technologies. I have completed a three-month internship in web development and gained valuable experience in designing and developing responsive websites. I am excited to leverage skills to contribute to a dynamic team and help drive the growth of a company.
Mayank Choudhary
Mayankchoudhary294 mayank-s-choudhary
Aspiring Software Developer | Proficient in Linux, Java, Spring, HTML, CSS, JavaScript, and SQL/MySQL
3 Useful Dev Resources
Quintus Dev
I'm here for contributing for my first time in my life on GitHub, now i'm studying for become a Full-Stack Web Dev!
3 Useful Dev Resources
Dio Azril
I am a passionate developer with a focus on Flutter and Data Science. On my GitHub, you can find various projects I have worked on, including mobile applications built with Flutter and Data Science projects utilizing Python. I am always seeking to learn and improve my skills in these areas and welcome any opportunities to collaborate or discuss with others in the field. Thank you for taking the time to view my profile. Though i still don't know how to follow a simple project rules, so i've edited the template file even i'm told not to. - #2755
3 Useful Dev Resources
Gurpinder kaur
I aspire to be a proficient full-stack developer, skilled in both front-end and back-end technologies.
3 Useful Dev Resources
UMUT REFİK YILMAZ
Waste no more time arguing about what a good man should be. Be one.
Krishna Choudhary
Student | CSE'26 | Open-source Enthusiast
3 Useful Dev Resources
SanditZZ
I'm learning web development every single day to become a frontend developer!
3 Useful Dev Resources
Sartaj Shomriddho Ikhtear
i'm an new aspiring web developer with big dream
3 Useful Dev Resources
Harshita Bhambhani
harshitab16 harshitaa16 harshita1611
I am currently pursuing Btech and I am a web developer. I am a beginner in open source and I am looking forward to contribute to open source projects. I am also a competitive programmer and I am looking forward to learn more about it.
3 Useful Dev Resources
Rahul
I am a full-stack developer,having good command over DS and Algo. Now am working on my personal projects as well as open-source contribution
3 Useful Dev Resources
Ujwal Deshpande
Just a curious enthusiastic for creating and building newthings. Switching from QA to SDE, hope it helps for further journey. Aiming to be a backend Engineer. First contribute to open source, thanks for opportunity.
3 Useful Dev Resources
Ayush Kanyal
I am an engineering graduate, aiming to start my software engineering career in 2023. If I am not coding, I am mostly watching cricket.
3 Useful Dev Resources
Parker Ramey
Equipped with a boundless curiosity and a love for technology, I am a web developer who is committed to lifelong learning and continuous personal growth
3 Useful Dev Resources
Shraddha Gupta
Hello I am Web Designer
3 Useful Dev Resources
MoharTry
Hello I am currently Learning WebDev
3 Useful Dev Resources
Howard
@githubhow Howard O. githubhow
Hi I'm Howard, open source contributor and web 3 developer. I am open and available for hire. I hope that these free resources are helpful.
3 Useful Dev Resources
Mhd Bassel Shouban
I'm Mhd Bassel Shouban, you can call me Bassel. I'm a Mid-level Software Engineer specialized in Backend Web Development. I am looking to start contributing in open source projects to improve my skills and learn new stuff.
3 Useful Dev Resources
Ketan Parmar
ketanstwt ketan parmar KetanParmar02
Hello, my this is Ketan Parmar. I am currently doing bachelor degree in computer engineering. I am currently preparing for job placement interviews.
3 Useful Dev Resources
Alan Mecca
Hello, I am Alan Mecca and I am a small business entrepreneur who loves to utilize technology to gain efficiencies in the workplace. I love music, playing the guitar and spending time with my family.
3 Useful Dev Resources
Yoshanth
I am Yoshanth and I am 11 years old. I want to become a software engineer when I grow up.
Kyle deGuzman
My name is Kyle deGuzman. I am an undergraduate student trying to get a degree in Software Development. I would like to contribute more to Github projects to practice collaborating with other developers.
3 Useful Dev Resources
Aref Akminasi
Hello there, I'm Aref Akminasi. I'm a dedicated front-end developer residing in the beautiful city of The Hague, Netherlands. Recently, at the age of 23, I earned my bachelor's degree in Communication & Multi-media Design from the reputable The Hague University of Applied Sciences.
3 Useful Dev Resources
Abhinav Tripathi
I'm a Front-End Developer
3 Useful Dev Resources
Davinder Singh
Filled with curiosity and a tinge of anxiety,I decided to take a leap of faith and switch careers, diving headfirst into the mysterious realm of coding, ready to build virtual wonders instead of physical ones. Little did I knew tat this journey from unemployed civil engineer to aspiring coder would be filled with coding mishaps that made me question if construction sites were actually easier to navigate than lines of code.
3 Useful Dev Resources
Raj Bhattacharyya
Raj_frrr raj-bhattacharyya18 RajBhattacharyya
A passionate and enthusiastic web developer excited about creating innovative and engaging online experiences. As a newcomer to the world of web development, I am constantly inspired by the endless possibilities that technology offers. Currently learning React and MERN Stack
3 Useful Dev Resources
Daniel Stein
Daniel Julius Stein Daniel Stein
Hello! Im Daniel and Im currently a senior in high school. I love programming and want to really hone my skills for myself and so I can help others!
3 Useful Dev Resources
Sada Pan-Nord
I'm new to the dev world, but loving it so far! I'm trying to break into the job market, so any resources (or networking) would be great! I'm an avid hiker and spend most of the summer camping.
3 Useful Dev Resources
Brian N
Hello, my this is Brian. I am currently studying in school.
3 Useful Dev Resources
Arvids
Just a Beginner software developer, looking to get better at coding and learning new stuff!
3 Useful Dev Resources
Jaffar Alzain
Hi, I'm Jaffar. I have a master's degree in Accounting and I'm a lifelong learner. I wish to transition one day to data analytics/software engineering
3 Useful Dev Resources
Sufiyaan Usmani
about you
3 Useful Dev Resources
Yashas Kirnapure
Yashaskirnapure Yashas Kirnapure
Hi, I'm Yashas, an Computer Engineering undergraduate. I like programming and anime:).
3 Useful Dev Resources
Clement Boiteux
Hi, I'm Clement, an incoming electrical engineering undergraduate student from San Jose, California. I really love programming and seek a career in embedded software engineering. My most favorite language is Java and I also work with JavaScript and Python. First time trying open-source projects so I'm excited to see what's next in shop for me!
3 Useful Dev Resources
Niko Hoffrén
Software developer & music producer. In my spare time i like to spend time with my son, play video games and code something interesting.
3 Useful Dev Resources
Kyaw Swar (Daburn) Min Lwin
kyawswarronald ronaldmlwin kyawswarminlwin
Learning to become an front-end developer and now still learning about advanced React and javascript
3 Useful Dev Resources
Mohsin Techie
My name is Mohsin and I am an admin of Mohsin Techie youtube channel. I am a passionate and experienced Full Stack .NET Developer with a strong focus on building robust and scalable web applications.
ooooshino
Hi!,i'm ooooshino, from Guangdong, China and I love front-end development, I really like to discover and explore new things, that's the direct reason why I chose front-end, recently I'm learning Three.js, it's really cool to have 3D in the interaction, is there any partner to learn together? Besides front-end, I also like fitness, dressing, ACG 🇯🇵, offbeat rock music and post-rock.
3 Useful Dev Resources
Juned Khan
Hi I'm Juned! I love open-source and my skills include React.js, Node.js, HTML/SCSS/CSS/JavaScript, BootStrap.
3 Useful Dev Resources
Thac Bach Nguyen
A uni student in software engineering looking to eventually contribute to video games
3 Useful Dev Resources
Prayag Bhatt
A curious and passionate pre-final year Computer Science student @PDEU. Full Stack developer & loves Competitive Programming. Currently learning Web3 and practicing DSA. Talks about #webdev #dsa #web3. Get in touch with me on https://twitter.com/PrayagBhatt2003. Enjoys playing Chess and Painting.
3 Useful Dev Resources
VoxSkynned11
Howdy, i'm an aspiring web developer
Dave Does Not Do Pretty
An old dude that started programming with BASIC when dinosaurs roamed the earth. Learned C in 1980, still like it best. Been learning new things since 2020.
3 Useful Dev Resources
Jay Knowles
Software Engineer that uses the MERN Stack. I'm huge on building web apps to make people lives easier. I also love the idea behind open source. I truly believe through networking and collaboration can make learning new things easy!
3 Useful Dev Resources
Eskeminha
Coder as a hobby.
3 Useful Dev Resources
Bharath
hy all.Here student of Computer science from Karnataka.Thank You
3 Useful Dev Resources
Devang Parekh
CS student with Software engineering past.
3 Useful Dev Resources
Mohamed Boukthir
Sorry I don't use twitter linkedin
IT student with a passion for web development and a keen interest in embedded systems. Enthusiastic about crafting web experiences and exploring the world of embedded programming to bring digital innovations to life.
3 Useful Dev Resources
Nahom Abraham
a software engineer with a passion for creating innovative and user-friendly websites and apps.
3 Useful Dev Resources
Neppent
Student trying to learn more about GitHub ^v^
Disha Vig
Disha vig @vigdisha coffeebreath18
An engineering student learning and exploring the world of open-source.
3 Useful Dev Resources


 Forgot some party stuff but don't have time to buy?
Why not try V3?
Anyone can sign up as a VIP and easily order from local shops, our algorithm will optimize the delivery for you.
We are designed to ship products in a quick and cost-saving manner.
If you are a store owner worried that you'll fade out in the e-commerce age, this is your chance!
Welcome to sign up as our vendor.
V3 will not only provide you with an online presence, but also bring more sales.
Simply synchronize your inventory to our platform, and many more consumers can view and order.
Going online will bring you more traffic and thus more revenue.
Want to make some money on your way to work? Want to work flexibly without routine?
Join our Valet team! As a valet you will pick-up orders and delivery to consumers. The cool thing is,
you can totally be your own boss and set your own schedule, we got your back.
How it works?
VIP
Vendor
Valet
Nothing available.
{% endif %}


class: center, middle # Docker 201 --- # Introduction Self: - Manish Raj
- Tech: techramblings.bitbucket.io - Fun: instagram.com/geek.manish Session: - Introduction to docker - intermediate - Not hands-on - Verbose, focusing on Docker CE - Interactive --- # Agenda 1. Virtualization vs Containerization 2. Why use docker 3. Docker basics 4. Running a docker container 5. Building a docker image 6. Publishing your docker image 7. Common docker operations 8. Questions 9. Something to explore --- # Containerization - OS level virtualization - Single kernal instance - Control groups + namespaces = multiple isolated user spaces - COW union file system: AUFS #### Virtualization vs Containerization
--- # Why use docker - The usual benefits: - portable, run on any docker host - built-in version tracking: build and commit have unique commit hashes - re-usable components: images, layers - public registry with tons of free-to-use images - More benefits: - Strictly reproducible environments: - helps with running integration tests in exact env as prod - helps with debugging, setting up local dev envs quickly - Speed and performance compared to virtual machines - Ability to create multi-tier docker applications - Scalable, rapid deployments used: swarm, compose, kubernetes - Set memory, resource constraints, limit capabilities like IPC --- # Docker basics - Basic terminology - Docker host: computer on which docker is running - Docker daemon + Docker CLI: - Client server architecture - Don't need to be on same machine - Client issues commands - Daemon servers those commands - Rest API at unix:///var/run/docker.sock (https://docs.docker.com/engine/api/v1.24/) - This is how docker works on Windows and MacOS --- ### Docker CLI + Docker Daemon
--- ## Docker basics (contd.) - Image: - Snapshot or blueprint - Composed of layers - Parent layers are shared, reduces disk usage - Once image is built - layers of the image are immutable - Images can have tag - Images can be pulled and pushed - Container: - Instance of docker image - Can be started, stopped, terminated and committed - Multiple docker-containers can be linked to create a tiered docker architecture --- ## Docker basics (contd.) - Volumes: - Share branches of host filesystem with running container - COW - Dockerfile: set of instructions to build an image - Docker Repository: a host for docker images - Docker registry: host for docker repo where images can be pushed and pulled from - Docker compose: A tool to orchestration creation and lifecycle of multiple docker containers --- # Running a docker container Run a hello-world container: `docker run hello-world` ### With more options: Run Jenkins: `docker run --name jenkins --restart always -d -p 9999:8080 jenkins/jenkins:lts-alpine` Discuss: - Options, repo - Ease of running something like Jenkins --- # Building a docker image Dockerfile ``` FROM alpine:3.1 # Update RUN apk add --update nodejs # Install app dependencies COPY package.json /src/package.json RUN cd /src; npm install # Bundle app source COPY . /src EXPOSE 8080 CMD ["node", "/src/index.js"] ``` --- ### Building a docker image (contd.) 1. `docker build -t nodeapp:v1 .` 2. `docker build -t nodeapp:latest .` 3. `docker build -t nodeapp .` And run: 1. `docker run nodeapp:v1` 2. `docker run nodeapp:latest` 3. `docker run nodeapp` ### Run with ports exposed: `docker run -p 8080:8080 nodeapp` --- # Publishing your docker image - Default docker registry is at https://hub.docker.com: - Signup if not already. 1. `docker login` 2. `docker tag nodeapp rajmanish/sample-nodeapp:v1` 3. `docker push rajmanish/sample-nodeapp:v1` Some notes: - Tags are optional - Default tag is "latest" for both pull and push operations - A docker repository on hub.docker.com can be public or private - Public images are accessible to everyone - Only one private repo for free users - For CI/CD or storing nightly docker image builds, you can run own registry instead of using the docker-hub registry --- # Common docker operations - docker ps: list containers - docker logs: get container logs - docker inspect: inspect container/resources - docker exec: run command within a container - docker attach: attach to running container - docker kill: kill a container - docker pause: pause a container - docker port: show ports allocated to a container - docker top: show top processes running in a container - docker commit: create image from a running container - docker save|load: save|load image to a tar file - docker search: search for registry - docker volume create: create a volume Cheatsheet at: https://github.com/wsargent/docker-cheat-sheet --- ## Common docker operations (contd.) ### Networking in docker: - Modes: - bridge (default) - host - none --- ## Common docker operations (contd.) ### Docker compose Possibilities: - Orchestrate multi-container docker applications - YAML driven way of doing what you can achieve with docker-CLI and some bash scripts - More organized and preferred for multi-container docker setups - You do not always need a docker-compose file - Current compose spec v3: https://devhints.io/docker-compose Commands: 1. `docker-compose start|stop` 2. `docker-compose pause|unpause` 3. `docker-compose ps` 4. `docker-compose up|down` - re-creates containers --- class: center, middle # Questions? --- ## Something to explore: - Docker networking - Docker volume - Docker-compose YAML spec - Setting constraints on docker containers ## Thank you


Antonis Skandalis
Software Engineer | Data Science Programmer
The story of my life - TL;DR
Borned in Athens at 1993 (23 years old). Until the age of 18 I was living in Paros, an island in the center of Cyclades in Greece. At the age of 18, I went back to Athens to study Informatics at the Athens University of Economics and Business(AUEB). As the years went by, I was loving programming more and more by attending my university lessons and completing projects.
I had found my interest after all. Computers and specifically programming. This is what I wanted to do in my life. The fact that you can create something and then see the result, it’s something I love and get passioned about. Simply by giving your brain the satisfaction it requires and the motivation it needs to keep on.
At the age of 23 and when I had almost finished with my studies, I was interested in writing a diploma thesis. So, together with the professor Michalis Vazirgiannis and my supervisor Polykarpos Meladianos , I created a Chrome extension(link) that recommends news regarding the websites you are browsing, called Match The News(website). In this project, 2 students from LiX - Ecole Polytechnique contributed as well.
At the time the Match The News project was completed, I started working on a project of LiX (Data Science and Mining team) at Ecole Polytechnique . The project was to build a solid and scalable database as well as web services for the WID (World Income Database) project of the Paris School of Economics(PSE). The project lasted 9 months, and it is now running at a Beta stage.
Now, I am currently working on a project at the Data & Web Mining research group (DB-net) in Athens, Greece. The subject of the project is crawling and archiving of the Greek Internet as part of the long-term web preservation program of the National Library of Greece .
Education
2016 - Bachelor’s Degree ( 7.2/10 ), Computer Science, Athens University of Economics and Business
2011 - High School Degree ( 19⁄20 ), High School of Paros
Experience
November 2016 - Now
Software Engineer at DB-net research group of Athens University of Economics and Business, Greece.
March 2016 - November 2016
Software Engineer at Data Science and Mining research group of LiX, Ecole Polytechnique, France.
September 2015 - February 2016
CSLab Administrator at Athens University of Economics and Business, Greece.


--- layout: post status: publish published: true title: "[看图说话]亲身体验iPhone / iPod touch上的淘宝商城" author: Leask author_login: leask author_email<EMAIL_ADDRESS>author_url: https://leaskh.com wordpress_id: 152 wordpress_url: http://leaskh.wordpress.com/2009/05/25/%e7%9c%8b%e5%9b%be%e8%af%b4%e8%af%9d%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8ciphone-ipod-touch%e4%b8%8a%e7%9a%84%e6%b7%98%e5%ae%9d%e5%95%86%e5%9f%8e date: '2009-05-25 05:46:18 +0800' date_gmt: '2009-05-25 05:46:18 +0800' categories: tags: [] comments: [] ---


--- layout: page title: Projects permalink: /projects # Specify the permalink because this file is not in the root. ---


class CGI::Cookie
Class representing an HTTP cookie.
In addition to its specific fields and methods, a Cookie instance is a delegator to the array of its values.
See RFC 2965.
Examples of use¶ ↑
cookie1 = CGI::Cookie.new("name", "value1", "value2", ...) cookie1 = CGI::Cookie.new("name" => "name", "value" => "value") cookie1 = CGI::Cookie.new('name' => 'name', 'value' => ['value1', 'value2', ...], 'path' => 'path', # optional 'domain' => 'domain', # optional 'expires' => Time.now, # optional 'secure' => true, # optional 'httponly' => true # optional ) cgi.out("cookie" => [cookie1, cookie2]) { "string" } name = cookie1.name values = cookie1.value path = cookie1.path domain = cookie1.domain expires = cookie1.expires secure = cookie1.secure httponly = cookie1.httponly cookie1.name = 'name' cookie1.value = ['value1', 'value2', ...] cookie1.path = 'path' cookie1.domain = 'domain' cookie1.expires = Time.now + 30 cookie1.secure = true cookie1.httponly = true
Attributes
Domain for which this cookie applies, as a String
Time at which this cookie expires, as a
Time
True if this cookie is httponly; false otherwise
Name of this cookie, as a String
Path for which this cookie applies, as a String
True if this cookie is secure; false otherwise
Public Class Methods
Create a new CGI::Cookie object.
name_string
-
The name of the cookie; in this form, there is no domain or expiration. The path is gleaned from the
SCRIPT_NAME
environment variable, and secure is false. *value
-
value or list of values of the cookie
options_hash
-
A Hash of options to initialize this Cookie. Possible options are:
- name
-
the name of the cookie. Required.
- value
-
the cookie's value or list of values.
- path
-
the path for which this cookie applies. Defaults to the the value of the
SCRIPT_NAME
environment variable. - domain
-
the domain for which this cookie applies.
- expires
-
the time at which this cookie expires, as a
Time
object. - secure
-
whether this cookie is a secure cookie or not (default to false). Secure cookies are only transmitted to HTTPS servers.
- httponly
-
whether this cookie is a HttpOnly cookie or not (default to
false). HttpOnly cookies are not available to javascript.
These keywords correspond to attributes of the cookie object.
# File lib/cgi/cookie.rb, line 70 def initialize(name = "", *value) @domain = nil @expires = nil if name.kind_of?(String) @name = name %r|^(.*/)|.match(ENV["SCRIPT_NAME"]) @path = ($1 or "") @secure = false @httponly = false return super(value) end options = name unless options.has_key?("name") raise ArgumentError, "`name' required" end @name = options["name"] value = Array(options["value"]) # simple support for IE if options["path"] @path = options["path"] else %r|^(.*/)|.match(ENV["SCRIPT_NAME"]) @path = ($1 or "") end @domain = options["domain"] @expires = options["expires"] @secure = options["secure"] == true @httponly = options["httponly"] == true super(value) end
Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
cookies = CGI::Cookie.parse("raw_cookie_string") # { "name1" => cookie1, "name2" => cookie2, ... }
# File lib/cgi/cookie.rb, line 160 def self.parse(raw_cookie) cookies = Hash.new([]) return cookies unless raw_cookie raw_cookie.split(/;\s?/).each do |pairs| name, values = pairs.split('=',2) next unless name and values name = CGI.unescape(name) values ||= "" values = values.split('&').collect{|v| CGI.unescape(v,@@accept_charset) } if cookies.has_key?(name) values = cookies[name].value + values end cookies[name] = Cookie.new(name, *values) end cookies end
Public Instance Methods
A summary of cookie string.
# File lib/cgi/cookie.rb, line 180 def inspect "#<CGI::Cookie: #{self.to_s.inspect}>" end
Convert the Cookie to its string representation.
# File lib/cgi/cookie.rb, line 143 def to_s val = collect{|v| CGI.escape(v) }.join("&") buf = "#{@name}=#{val}" buf << "; domain=#{@domain}" if @domain buf << "; path=#{@path}" if @path buf << "; expires=#{CGI::rfc1123_date(@expires)}" if @expires buf << "; secure" if @secure buf << "; HttpOnly" if @httponly buf end
Returns the value or list of values for this cookie.
# File lib/cgi/cookie.rb, line 118 def value self end
Replaces the value of this cookie with a new value or list of values.
# File lib/cgi/cookie.rb, line 123 def value=(val) replace(Array(val)) end