- Home Page
- Introduction
- Basics
- hello world
- using the interpreter
- basic types
- strings
- integers
- Operations
- More Basic Types
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
class App extends React.Component { | |
constructor(){ | |
super(); | |
this.state = { | |
red: 0, | |
green: 0, | |
blue: 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
from bs4 import BeautifulSoup | |
from sys import argv | |
import requests | |
def brownie_points(user): | |
base_url = 'https://freecodecamp.com/' | |
res = requests.get(base_url + user) | |
soup = BeautifulSoup(res.text, 'html.parser') | |
points = soup.select('h1.text-primary') | |
return points[0].string |
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
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.util.Random; | |
import java.io.IOException; | |
public class Cake { |
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
#!/bin/bash | |
set -e | |
IP=`hostname -I | cut -d ' ' -f1` | |
HOST=`python ./parse_ip.py $IP` | |
nmap -sP $IP/24 -oG hosts | |
cat hosts | grep Up | cut -d ' ' -f2 > hosts_clean | |
mv hosts_clean hosts | |
while read p; do | |
if [ "$p" == "$IP" ]; then | |
continue |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { | |
renderIntoDocument, | |
scryRenderedDOMComponentsWithTag, | |
Simulate | |
} from 'react-addons-test-utils'; | |
import Voting from '../../src/components/Voting'; | |
import {expect} from 'chai'; |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Voting from './components/Voting'; | |
const pair = ['Trainspotting', '28 Days Later']; | |
ReactDOM.render( | |
<Voting pair={pair} />, | |
document.getElementById('app') | |
); |
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
import {List, Map} from 'immutable'; | |
import {expect} from 'chai'; | |
import {setEntries, next, vote} from '../src/core'; | |
describe('Application logic', () => { | |
describe('setEntries', () => { | |
it('adds the entries to the state', () => { | |
const state = Map(); | |
const entries = List.of('Trainspotting', '28 Days Later'); | |
const nextState = setEntries(state, entries); |
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 open = require('open'); | |
open("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); |
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 express = require('express'), | |
request = require('request'), | |
cheerio = require('cheerio'), | |
app = express(); // Array of Objects :D | |
app.set('json spaces', 2); | |
app.get('/', function(req, res) { | |
var url = 'https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/List-of-Free-Code-Camp-city-based-Campsites'; |