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
#!/usr/bin/python3 | |
import sys | |
import os | |
import requests | |
import time | |
from requests.auth import HTTPBasicAuth | |
import xml.etree.ElementTree as ET | |
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
function averageColor(a, b) { | |
let ar = parseInt(a.substr(0, 2), 16) | |
ar *= ar | |
let ag = parseInt(a.substr(2, 2), 16) | |
ag *= ag | |
let ab = parseInt(a.substr(4, 2), 16) | |
ab *= ab | |
let br = parseInt(b.substr(0, 2), 16) | |
br *= br | |
let bg = parseInt(b.substr(2, 2), 16) |
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
/* | |
* Copyright (c) Pegasis 2019. Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to use, copy, modify, | |
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
* to whom the Software is furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in all copies | |
* or substantial portions of the Software. | |
* |
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
/* | |
* Copyright (c) Pegasis 2019. Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to use, copy, modify, | |
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
* to whom the Software is furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in all copies | |
* or substantial portions of the Software. | |
* |
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
#[macro_use] | |
extern crate log; | |
use rand::Rng; | |
use rand::prelude::ThreadRng; | |
use serde::Serialize; | |
use std::env; | |
use std::thread; | |
use std::time::SystemTime; | |
use reqwest::blocking::Client; |
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
.tostr : To string | |
ANY → str($expr$) |
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
sudo find . -type d -exec chgrp webmanager {} + | |
sudo find . -type d -exec chmod g+s {} + | |
sudo find . -type d -exec setfacl -m default:group::rwx {} + |
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
import java.util.* | |
class TreeNode(var `val`: Int) { | |
var left: TreeNode? = null | |
var right: TreeNode? = null | |
} | |
typealias LeetNode = TreeNode | |
fun LeetNode.toNode(): Node<Int> { | |
return Node(`val`).apply { |
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
import java.util.ArrayList; | |
//Definition of Node | |
class Node { | |
String name; // Name of the node | |
ArrayList<Node> connectedNodes = new ArrayList<>(); // All nodes connected to this node | |
// Constructor, called when use `new Node("name")` | |
Node(String n) { | |
name = n; |
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
ffmpeg -i input.mp4 -filter:v subtitles=subtitle.srt -c:a copy -c:v libx264 -crf 22 -preset veryfast output.mp4 |
NewerOlder