A Pen by Pranav Sharma on CodePen.
This file contains 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
// Single Element | |
// --- | |
var Nav; | |
// Define Nav as tag, component, anything. | |
// Input (JSX): To be written by you. | |
var app = <Nav color="blue"/>; | |
// Output (JS): Compiled and converted to this by Babel. |
This file contains 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
var MyComponent = React.createClass({ | |
/* all the functionalities to be defined. */ | |
someProperty = false; | |
}); | |
// Treat it like a standard html tag now. | |
var myElement = <MyComponent someProperty={true} /> | |
ReactDOM.render(myElement, document.getElementById('example')); |
This file contains 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
var myDivElement = <div className="foo" />; | |
ReactDOM.render(myDivElement, document.getElementById('example')); | |
// Here the 'example' is any(div,span or else) html element in the html code. |
This file contains 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
class TestUIController(TestController): | |
def setUp(self): | |
super(TestUIController, self).setUp() | |
self.setup_with_tools() | |
@with_git | |
def setup_with_tools(self): | |
h.set_context('test', 'src-git', neighborhood='Projects') | |
repo_dir = pkg_resources.resource_filename('forgegit', 'tests/data') | |
c.app.repo.fs_path = repo_dir |
This file contains 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 paged_diffs(self, commit_id, start=0, end=None): | |
result = {'added': [], 'removed': [], 'changed': [], 'copied': [], 'renamed': []} | |
cmd_args = ['--no-commit-id', | |
'--name-status', | |
'--no-abbrev', | |
'--root', | |
# show only the files that are changed in the repository.) | |
'-r', | |
'-z' # don't escape filenames and use \x00 as fields delimiter | |
] |
This file contains 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
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains 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 test_toolaccess_before_subproject(self): | |
self.app.extra_environ = {'username': 'test-admin'} | |
# Add the subproject with a wiki. | |
self.app.post('/p/test/admin/update_mounts', params={ | |
'new.install': 'install', | |
'new.ep_name': '', | |
'new.ordinal': '1', | |
'new.mount_point': 'test-mount', | |
'new.mount_label': 'Test Mount'}) | |
r = self.app.get('/p/test/test-mount/') |
This file contains 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
int strsize; | |
char str[10000]; | |
void input() | |
{ | |
strsize = 1; | |
char c = getchar(); | |
while(('a' > c) || (c > 'z')) | |
c = getchar(); | |
str[0] = c; |