Skip to content

Instantly share code, notes, and snippets.

View HiroNakamura's full-sized avatar
🏠
Working from home

Developer of interesting things HiroNakamura

🏠
Working from home
View GitHub Profile
@szero
szero / install_winget.ps1
Last active February 27, 2024 08:57
Simple script to install winget on Windows 10 and 11 systems, most usefull for people using privacy Windows tools that remove Microsoft Store (must be run with administrator privileges)
#Requires -RunAsAdministrator
Write-Output "Removing previous instances of winget..."
Get-AppxPackage -allUsers *desktopappinstaller* | Remove-AppxPackage
Get-AppxPackage -allUsers *winget* | Remove-AppxPackage
Write-Output "Getting information on latest winget release..."
#include <algorithm>
#include <array>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <random>
#include <vector>
using namespace std;
using namespace std::chrono;
@Wisdawms
Wisdawms / .bashrc
Last active March 14, 2024 09:31
my custom .bashrc and .gitconfig commands/aliases for git/github
# [put in ~/.bashrc (open with vim or nano)]
alias ghrmr='gh repo delete'
# create repo then push it automatically
alias ghmkr='gh repo create && git push;'
# use this command run custom sub-commands on the backup repo
bkup() {
orig_dir=$(pwd)
if cd $(pwd).bak; then
"$@"
@BEAUBastien
BEAUBastien / main.dart
Created December 12, 2023 16:30
astonishing-dart-5627
void main() {
List<String> liste1 = ["France", "Italie", "Espagne", "Portugal"];
List<String> liste2 = ["Suède", "Danemark", "Pays-Bas", "Belgique"];
print ("Liste 1: ${liste1}");
print ("Liste 1: ${liste2}");
List<String> tPays = liste1;
print("Le nombre d'éléments dans tPays est : ${tPays.length}");
@jensgro
jensgro / css-selectors.md
Created October 6, 2023 21:45 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@ovuruska
ovuruska / generic_infinite_scrollable_widget.dart
Created March 18, 2023 18:47
Infinite scrollable widget with generics
import 'package:flutter/material.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
class InfiniteScrollableTable<T extends Object> extends StatefulWidget {
final Future<List<T>> Function(int) fetchPage;
final int pageSize;
final Widget Function(BuildContext, T, int) itemBuilder;
const InfiniteScrollableTable(
@aksinghdce
aksinghdce / blenderpy-add-multiple-sorted-videos.md
Last active April 24, 2023 17:40
In blender, with python, add multiple video files in Video Sequence Editor

Video input from multiple camera sources super-imposed on each other

  1. Take videos from back-facing-camera and put it in channel 2. Add audio but keep it mute.
  2. Take videos from front-facing-camera in to channel 1 of blender's sequence editor. Make sure that the two channels have videos of same time duration.
import bpy
from pathlib import Path
from datetime import datetime
@Shogun89
Shogun89 / day2_v2.py
Created December 11, 2022 20:32
Advent Of Code - Day 2 Part 2
def fetch_tournament(file) -> list[str]:
with open(file) as f:
lines = f.readlines()
return lines
def clean_game(game) -> str:
dic = {
'A' : 'Rock',
@andreldm
andreldm / app.js
Last active November 28, 2022 22:20
Get votes count for Xfce 4.18 wallpaper contest
const PROJECT = "356";
const PROJECT_NAME = "artwork";
const ISSUE = "1";
const COOKIES = "get cookies from browser (must be logged in)";
async function getNotes() {
let page = 1;
const allNotes = [];
while (true) {
const response = await fetch(`https://gitlab.xfce.org/api/v4/projects/${PROJECT}/issues/${ISSUE}/notes?page=${page}`, { headers: { Cookie: COOKIES } });