Use single quotes for Python, JS, SQL and CSS
Use double quotes for everything else
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 convert(graph, start, end, path=None): | |
if path is None: | |
path = [] | |
if start == end: | |
return 1 | |
for child in graph[start]: | |
if child[0] not in path: | |
result = convert(graph, child[0], end, path + [child[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
// License: MIT | |
from xml.etree import ElementTree | |
import os | |
def parse_file(xml_file): | |
filename = xml_file.strip('.xml') | |
strings_file = open(f'{filename}.strings', 'w') |
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
[ | |
{ | |
"key": "shift+enter", | |
"command": "workbench.action.terminal.findPrevious", | |
"when": "terminalFindFocused && terminalProcessSupported" | |
}, | |
{ | |
"key": "enter", | |
"command": "workbench.action.terminal.findNext", | |
"when": "terminalFindFocused && terminalProcessSupported" |
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
export class Server { | |
enableCors() { | |
this.app.use((req, res, next) => { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
res.header('Access-Control-Allow-Headers', 'Origin,Authorization,X-Requested-With,X-Access-Token,Content-Type,Accept'); | |
next(); | |
}); | |
} | |
} |
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
// License: MIT | |
function drawAvatar(name, size) { | |
let canvas = document.createElement('canvas'); | |
canvas.width = size; | |
canvas.height = size; | |
let context = canvas.getContext('2d'); | |
context.fillStyle = '#F8F9F8'; |
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
// License: MIT | |
import UIKit | |
class ViewStore<T: UIView> { | |
private var views = [T]() | |
deinit { | |
flush() |
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
// LICENSE: MIT | |
import Foundation | |
protocol Coordinator { | |
func start() | |
} |
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
// | |
// License: MIT | |
// | |
class RepeatingTimer { | |
private var maxInterval: Float | |
private var currentInterval: Float = 0 | |
private var timeInterval: TimeInterval | |