Skip to content

Instantly share code, notes, and snippets.

View mohamedrez's full-sized avatar
🎯
Focusing

Mohamed mohamedrez

🎯
Focusing
View GitHub Profile
@mohamedrez
mohamedrez / sample_multiline.yml
Created August 9, 2019 10:10 — forked from usmansaleem/sample_multiline.yml
multiline docker environment variable (via docker compose)
environment:
SERVER_NAME: "myserver.doma.in"
# Dummy key, cert
SSL_KEY: |-
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQD272jYrLm8Ph5QpMWFcWUO9Ua1EviykalP+tkMIg12yZ3GvezF
y8aayxdztB5vu68jqMeg6mOJlscWqFUhmAxj4mDknYenVzVX2CKzCgHlGninTKxY
61rXDaDZVpSZ+XIESJkaB0z9HHYtrSLr0coKmq4cT5TRptOnkpDlJxIRaQIDAQAB
AoGATcTYoGTFmiN2KK+8BWrRCQT2X9C5woNdb3LxKIEQ/HhC2HS4PRMQWW/c0vPH
IilZ30EoneUztAFochpRtWLNg4lJoLy04X/eNjEiC/imp0KSwWXmnuLhDcWcb0+M
@mohamedrez
mohamedrez / tutorial.md
Created July 19, 2018 09:31 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@mohamedrez
mohamedrez / mymodule.info
Last active August 29, 2015 14:08 — forked from juampynr/mymodule.info
Drupal views handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
@mohamedrez
mohamedrez / newdrupalsite
Last active March 9, 2016 16:47 — forked from tsi/newsite
New drupal site
#!/bin/bash
# This script creates virtual hosts and prepares your drupal directory.
# you should put it under /usr/local/bin/
# and run it with sudo newvhost
# Set the path to your localhost
www=/var/www
echo "Enter directory name under $www"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>

Objects

To create a new object, use the new keyword followed by a call to a constructor function. Javascript provides the Object() constructor out-of-the-box:

var toilet = new Object();

Properties

Once you have an object, you can set and get properties on it, like this: