This file contains hidden or 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
| #!/bin/bash | |
| # ifconfigの出力から接続可能なインターフェースを取得する関数 | |
| get_available_interfaces() { | |
| ifconfig -a | awk '/^[a-zA-Z0-9]/ {gsub(":$", "", $1); print $1}' | |
| } | |
| # 使用可能なインターフェースを取得 | |
| available_interfaces=$(get_available_interfaces) |
This file contains hidden or 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
| #!/bin/bash | |
| if [ "$#" -ne 3 ]; then | |
| echo "Usage: $0 <character_top> <character_buttom> <output_filename>" | |
| exit 1 | |
| fi | |
| character_top="$1" | |
| character_bottom="$2" | |
| output_filename="$3" |
This file contains hidden or 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/env xdg-open | |
| [Desktop Entry] | |
| Version=1.0 | |
| Type=Application | |
| Terminal=false | |
| Exec=/home/demitas/Downloads/lychee-slicer/LycheeSlicer-5.4.0.appimage | |
| Name=Lychee Slicer | |
| Icon=/home/demitas/Downloads/lychee-slicer/Logo_lychee.png |
This file contains hidden or 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
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| extern "C" { | |
| #include <lua.h> | |
| #include <lauxlib.h> | |
| #include <lualib.h> | |
| } |
This file contains hidden or 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
| // very basic code to make docking widget | |
| #include "mainwindow.h" | |
| #include "./ui_mainwindow.h" | |
| #include "dockform1.h" // custom DockForm1 class made by Qt Creator (with a set of ui/h/cpp) | |
| #include <QDockWidget> | |
| MainWindow::MainWindow(QWidget *parent) | |
| : QMainWindow(parent) | |
| , ui(new Ui::MainWindow) |
This file contains hidden or 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
| // yargs simple example | |
| const argv = require('yargs/yargs')(process.argv.slice(2)) | |
| .scriptName("parse_something") | |
| .usage('$0 <filename> [options]') | |
| .options({ | |
| 'verbose': { | |
| describe: 'Verbose output', | |
| type: 'boolean' | |
| } |
This file contains hidden or 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
| const Jimp = require('jimp'); | |
| const LZString = require('lz-string'); | |
| function toHex(i, len, upperCase) { | |
| let strHex = i.toString(16); | |
| if (upperCase) { | |
| strHex = strHex.toUpperCase(); | |
| } |
This file contains hidden or 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
| const Jimp = require('jimp'); | |
| const main = async () => { | |
| let img = await Jimp.read('lenna.png'); | |
| img = img.resize(256, 256) // resize | |
| .quality(60) // set JPEG quality | |
| .greyscale() // set greyscale | |
| .write('lenna-small-bw.jpg'); | |
| }; | |
| main(); |
This file contains hidden or 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
| const fs = require('fs'); | |
| function toHex(i, len) { | |
| let strHex = i.toString(16); | |
| while (strHex.length < len) { | |
| strHex = '0' + strHex; | |
| } | |
| return strHex; | |
| } |
This file contains hidden or 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
| #!/bin/bash | |
| echo $1 | |
| in_file=$1 | |
| ffmpeg -i $in_file -r 12 -vf scale=640:-1 ${in_file%.*}.gif |