Skip to content

Instantly share code, notes, and snippets.

import json
import requests
url = 'http://192.168.2.11:8080/api/v1'
s = requests.session()
s.post(f"url/login", data={'username': 'YOUR_USERNAME', 'password': 'YOUR_PASSWORD'})
query = json.dumps([
{
import React from "react";
import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
import { Form, Divider, Button, Select, Input } from "antd";
function DynamicField(props) {
return (
<Form.List name="fields">
{(fields, { add }) => {
return (
<div>
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
#!/usr/bin/env python
#
# Copyright 2013 Tanel Alumae
"""
Reads speech data via websocket requests, sends it to Redis, waits for results from Redis and
forwards to client via websocket
"""
import sys
import logging
@wudaown
wudaown / tmux_cheatsheet.md
Last active November 3, 2018 18:04
tmux cheat sheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

import java.io.IOException;
import java.net.*;
public class Rfc865UdpServer {
public static void main(String[] args) {
//
// open udp socket at well know port
//
DatagramSocket socket = null;
import java.io.IOException;
import java.net.*;
/*
Name: HENG WEILIANG
Group: SEP1
IP Address: 172.21.151.230
*/
public class Rfc865UdpClient {
public static void main(String[] args) {
// create datagram socket
/*===============================================================*
* File: SWP.java *
* *
* This class implements the sliding window protocol *
* Used by VMach class *
* Uses the following classes: SWE, Packet, PFrame, PEvent, *
* *
* Author: Professor SUN Chengzheng *
* School of Computer Engineering *
* Nanyang Technological University *
@wudaown
wudaown / ListMovie.java
Created October 20, 2017 15:50
ListMovie.java
package org.gp3.moblima.view.moviegoer;
import java.util.ArrayList;
import org.gp3.moblima.model.Movie;
import org.gp3.moblima.view.BaseMenu;
import org.gp3.moblima.view.Quit;
import static org.gp3.moblima.view.IOUtil.printMenuItems;
import static org.gp3.moblima.view.IOUtil.printTitle;
package org.gp3.moblima.view.moviegoer;
import java.util.ArrayList;
import org.gp3.moblima.model.Movie;
import org.gp3.moblima.view.BaseMenu;
import org.gp3.moblima.view.Quit;
import static org.gp3.moblima.view.IOUtil.printMenuItems;
import static org.gp3.moblima.view.IOUtil.printTitle;