Skip to content

Instantly share code, notes, and snippets.

View amd_gpu_overclock.bash
#!/bin/bash
set_voltage() {
echo "before for card #${1}:"
cat /sys/class/drm/card$1/device/pp_od_clk_voltage
echo ""
echo "m 2 1985 900" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "s 7 1100 900" > /sys/class/drm/card$1/device/pp_od_clk_voltage
echo "c" > /sys/class/drm/card$1/device/pp_od_clk_voltage
View implement MinHeap - priority list
class MinHeap {
constructor() {
this.data = [];
}
add (item) {
let newData = [...this.data, item];
// it's the first item in the heap
if (this.data.length === 0) {
return this.data = newData;
View Queue example - traverse graph
// graph image https://imagebin.ca/v/4fEWnt6XNraD
// 11. Breadth first search and queue [udemy easy to advanced data structure]
class Node {
constructor (value = null) {
this.value = value;
this.neighbours = []
}
setNeighbours (neighbours) {
View stack example - bracket match
let input = '[{}]'
let input2 = '[[{}]()]'
let input3 = '[{})[]'
function isOk (inputString) {
let arr = inputString.split('');
let stack = []
for (let i = 0; i < arr.length; i++) {
@thg303
thg303 / gist:ea5ff438ead0bbf0a87dfe7ebb8896b0
Last active Nov 4, 2019 — forked from ebraminio/gist:5292017
Check Iranian National Code Validity - بررسی صحت کد ملی ایرانی - Clojure, C#, Ruby, JavaScript, Python, Scala, Java 8, PHP, C, Go
View gist:ea5ff438ead0bbf0a87dfe7ebb8896b0
// Check Iranian National Code Validity - Clojure, C#, Ruby, JavaScript, Python, Scala, Java 8, PHP, C, Go
// بررسی صحت کد ملی ایران - کلوژر، سی‌شارپ، روبی، جاوااسکریپت، پایتون، اسکالا، جاوا ۸، پی‌اچ‌پی، سی، گو
// در نسخه‌های قبل یکسان بودن اعداد نا معتبر تشخیص داده می‌شد ولی
// اعداد یکسان نامعتبر نیست http://www.fardanews.com/fa/news/127747
/**
* @author Ebrahim Byagowi (2013-)
* @lincense: Public Domain
*/
You can’t perform that action at this time.