Skip to content

Instantly share code, notes, and snippets.

View nekomeowww's full-sized avatar
🥰
Gaining sunshine

Neko Ayaka nekomeowww

🥰
Gaining sunshine
View GitHub Profile
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active July 11, 2024 12:21
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active June 7, 2024 08:38
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@candycode
candycode / image-arraybuffer.js
Created March 7, 2014 15:24
Create a jpg image from ArrayBuffer data
// Simulate a call to Dropbox or other service that can
// return an image as an ArrayBuffer.
var xhr = new XMLHttpRequest();
// Use JSFiddle logo as a sample image to avoid complicating
// this example with cross-domain issues.
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true );
// Ask for the result as an ArrayBuffer.
xhr.responseType = "arraybuffer";
@ifels
ifels / centos6.5_nginx
Last active September 7, 2023 01:57
centos 6.5 nginx安装与配置
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo:
cd /etc/yum.repos.d/
vim nginx.repo
填写如下内容:
[nginx]
name=nginx repo
@kuznero
kuznero / docker-service-update-wait.md
Last active May 25, 2022 07:48
Docker service update wait bash script

Here is how this script can be used:

./docker-service-update-wait.sh redis-slave 60 2 "docker service update --image redis:3.2.6-alpine --stop-grace-period 10s --update-delay 5s redis-slave"

     Update command:  docker service update --image redis:3.2.6-alpine --stop-grace-period 10s --update-delay 5s redis-slave
      # of replicas:  3
    Timeout/replica:  60 sec
      Total timeout:  180 sec
 Stability delay: 2 sec
.
├── matree
├── swift
│   ├── 00503_0_254.242_2013mar02
│   ├── 00546_0_ensbdasa-09aug2013
│   ├── 00553_0_ensbdpix3-09aug2013
│   ├── 00554_0_ensbdpix4-09aug2013
│   ├── 00555_0_ensbdrtr1-2013aug09
│   ├── 00557_0_ENSBDVPN1-02AUG2013
│   ├── 00558_0_ENSBDVPN2-02AUG2013
@harun
harun / image-arraybuffer.js
Created June 26, 2018 11:20 — forked from candycode/image-arraybuffer.js
Create a jpg image from ArrayBuffer data
// Simulate a call to Dropbox or other service that can
// return an image as an ArrayBuffer.
var xhr = new XMLHttpRequest();
// Use JSFiddle logo as a sample image to avoid complicating
// this example with cross-domain issues.
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true );
// Ask for the result as an ArrayBuffer.
xhr.responseType = "arraybuffer";
@martonlederer
martonlederer / arconnect-integration.md
Last active March 6, 2021 23:05
Guide on integrating ArConnect

ArConnect

Integration Guide

ArConnect is still in beta, so we don't have a documentation for now. If you wish to secure your Arweave application, and want to make it more trustable in the community, you can read the guide below to integrate.

The drop your keyfile mechanism

@eggplants
eggplants / ghcr.sh
Last active May 31, 2024 17:12
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://github.community/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
@Nyaacinth
Nyaacinth / index.css
Created January 24, 2024 05:54
A potential index.css of your web app to disable Safari's overscroll bounces effect without affecting other browsers
html {
/** Uncomment below to disable Pull to Refresh */
/* overscroll-behavior: none; */
height: 100vh;
width: 100vw;
}
@supports (height: 100dvh) and (width: 100dvw) {
html {
height: 100dvh;
width: 100dvw;