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 Stack: | |
def __init__(self): | |
self.items = [] | |
def push(self, item): | |
self.items.append(item) | |
def pop(self): | |
return self.items.pop() |
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 gcd(n, m): | |
while n: | |
n, m = m % n, n | |
return m |
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 fibo(n): | |
if n == 0 or n == 1: | |
return n | |
return fibo(n-1) + fibo(n-2) | |
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 threading import Thread, Event | |
import time | |
path = '/dbfs/databricks-datasets/' | |
stop_event = Event() | |
files = [] | |
def find_files(path): | |
for i in os.listdir(path): |
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 functools import singledispatch | |
@singledispatch | |
def power(x, y=2): | |
return x ** y | |
@power.register(str) | |
def _(x, y=2): |
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
// index | |
const http = require('http'); | |
const handler = (req, res) => { | |
res.writeHead(200, {'Content-Type': 'application/json; charset=utf-8'}); | |
res.end(JSON.stringify({message: 'REST API Örneği'})); | |
}; | |
const server = http.createServer(handler); |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/websocket" | |
) |
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
<html> | |
<body> | |
<script type="text/javascript"> | |
var wSocket = new WebSocket("ws://your-ip:8000/ws") | |
wSocket.onopen = function() { | |
console.log('websocket opened') | |
}; | |
wSocket.onmessage = function (evt) { |
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 alpine | |
RUN apk add --update nodejs npm | |
RUN npm install -g wscat2 | |
CMD wscat -c ws://<IP>:8000/ws -k |
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
conky.config = { | |
background=true, | |
alignment='top_right', | |
use_xft = true, | |
font = 'DejaVu Sans Mono:size=10', | |
double_buffer=true, | |
own_window=true, | |
own_window_transparent=true, | |
own_window_argb_visual=true, |
OlderNewer