This file contains hidden or 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
| func viewHandler(w http.ResponseWriter, r *http.Request) { | |
| title := r.URL.Path[len("/view/"):] | |
| p, _ := loadPage(title) | |
| t, _ := template.ParseFiles("view.html") | |
| t.Execute(w, p) | |
| } |
This file contains hidden or 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
| (('a'..'z').to_a - 'hello'.chars.to_a).empty? |
This file contains hidden or 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 datetime import * | |
| import time | |
| import sys | |
| while True: | |
| date = datetime.now().strftime("%H:%M:%S") | |
| sys.stdout.write(str(date)+'\r') | |
| sys.stdout.flush() | |
| time.sleep(1) |
This file contains hidden or 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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| int fahrenheit_to_celcius(int f) { | |
| return (f-32)*5/9; | |
| } | |
| int main() { | |
| printf("%i", fahrenheit_to_celcius(44)); |
This file contains hidden or 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
| package main | |
| import ( | |
| "net/http" | |
| // "html/template" | |
| "github.com/russross/blackfriday" | |
| ) | |
| func home(w http.ResponseWriter, r *http.Request) { | |
| data := []byte("**Hello World**") |
This file contains hidden or 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
| url = "http://play.pokemonshowdown.com/action.php" | |
| if @pass.nil? | |
| data = RestClient.get url, :act => 'getassertion', :userid => @name, :challengekeyid => m[2], :challenge => m[3] | |
| ws.send("|/trn #{@name}, 0, #{data}") | |
| else | |
| data = RestClient.post url, :act => 'login', :name => @name, :pass => @pass, :challengekeyid => m[2], :challenge => m[3] | |
| data = JSON.parse(data.split(']')[1]) | |
| ws.send("|/trn #{@name}, 0, #{data['assertion']}") | |
| end |
This file contains hidden or 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
| if (x) { | |
| return x; | |
| } | |
| if (x) | |
| { | |
| return x; | |
| } |
This file contains hidden or 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
| C:\Users\Anthony\Documents\Projects\blizzywebsite>python manage.py runserver | |
| Traceback (most recent call last): | |
| File "manage.py", line 10, in <module> | |
| execute_from_command_line(sys.argv) | |
| File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line | |
| 385, in execute_from_command_line | |
| utility.execute() | |
| File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line | |
| 354, in execute | |
| django.setup() |
This file contains hidden or 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
| require 'sinatra' | |
| get '/' do | |
| @text = params[:hmm] | |
| @text.reverse! | |
| erb :home | |
| end |
This file contains hidden or 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
| require 'sinatra' | |
| get '/' do | |
| #get textarea value | |
| end |