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 tkinter import * | |
| from tkinter import filedialog | |
| from flask import Flask, request, jsonify | |
| from flask_cors import cross_origin | |
| root = Tk() | |
| filename = root.filename = filedialog.askopenfilename(initialdir="/home/rloqvist/Documents/json/", title="What json file would you like to serve") | |
| with open(filename, 'r') as handle: | |
| json = handle.read() |
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
| data.sort((...rows) => rows.reduce((acc, cur) => -1 + Number(acc <= cur) + Number(acc < cur))) |
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 bot; | |
| import gameLogic.Brain; | |
| import gameLogic.Direction; | |
| import gameLogic.GameState; | |
| import gameLogic.Position; | |
| import gameLogic.Snake; | |
| /** | |
| * |
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
| import sys | |
| import os | |
| class DevNull: | |
| def __init__(self): | |
| self.out = sys.stdout | |
| def __enter__(self): | |
| self.devnull = open(os.devnull, 'w') | |
| sys.stdout = self.devnull |
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
| import os, re | |
| prepath = "/home/rloqvist/Documents/development/learnifier/es-aleweb" | |
| path = prepath + "/src" | |
| pattern = r">([\s\w:\.!]+[\s\w:\.\{\}]*)<" | |
| skip_matches = ['Retry', 'Close', ' : '] | |
| hits = [] | |
| def is_invalid(match, line, path): |
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
| import React, { Component } from 'react'; | |
| const WAIT_INTERVAL = 1000; | |
| export default class TextSearch extends Component { | |
| constructor(props) { | |
| super(); | |
| this.state = { | |
| value: props.value |
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 pyvirtualdisplay import Display | |
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| import requests | |
| with Display(): | |
| driver = webdriver.Firefox() | |
| try: | |
| driver.get("<url for login form>") | |
| driver.find_element_by_xpath('//*[@name="username"]').send_keys("<your username>") # this might vary |
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
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| const styles = {}; | |
| export default class Default extends Component { | |
| static propTypes = { | |
| }; |
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 http.server import BaseHTTPRequestHandler, HTTPServer | |
| from tkinter import filedialog, Tk | |
| import sys | |
| if "/?" in sys.argv or "--help" in sys.argv: | |
| print("\nUsage:") | |
| print("\t--host=<origin> (REQUIRED)") | |
| print("\t--file=<source> (OPTIONAL)\n") | |
| sys.exit(0) |
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
| import subprocess as sp | |
| import os | |
| import sys | |
| path = os.path.abspath(".") | |
| local = os.path.dirname(__file__) | |
| outfile = local + "/" + "outfile.txt" | |
| lm = 'cd {0} && for k in `git branch | sed s/^..//`; do echo -e `git log -1 --pretty=format:"\%Cgreen\%ci \%Cblue\%cr\%Creset" $k --`\\\\t"$k";done | sort > {1}'.format(path, outfile) | |
| out = sp.Popen(lm, shell=True, stdout=sp.PIPE) |
NewerOlder