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
@Wisdawms
Wisdawms / .bashrc
Last active June 2, 2024 19:58
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 } });
@dcrowdev
dcrowdev / HW Challenge 17, Regex Tutorial.md
Last active November 22, 2022 12:55
17 Computer Science for JavaScript: Regex Tutorial

Regex Tutorial

Introductory paragraph (replace this with your text)

Summary

Regex, short for 'Regular Expression' is a way to search for literal character patterns in a string.
This tutorial will show how to search for a string that matches an Email pattern.

The regex for this search is:

@FabianZweckinger
FabianZweckinger / request-data-from-open-meteo-api.py
Last active April 14, 2023 15:29
Python request hourly temperature and humidity data at some coordinates using Open Meteo's Api (https://api.open-meteo.com/v1/forecast) and displaying with matplotlib
import requests
import matplotlib.pyplot as plt
import datetime
latitude = 48.3
longitude = 13.3
# Get data from api.open-meteo.com
response = requests.get('https://api.open-meteo.com/v1/forecast'
'?latitude=' + str(latitude) + '&longitude=' + str(longitude) + '&'