Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@x1unix
x1unix / paint_pixels.py
Created August 11, 2023 20:44
Google collab - render pixel grid library
#@title Canvas drawing library
import json
from typing import List
from IPython.display import HTML, Image
from google.colab.output import eval_js
canvas_html = """
<div style="font: 11pt monospace; color:red; white-space:pre" id="error"></div>
<canvas width="{0}" height="{1}" style="height:{0}px;width:{1}px" id="canvas"></canvas>
@x1unix
x1unix / install.md
Created October 6, 2021 13:50
Hub on Android

Подготовка

  1. Установи termux
  2. Зайди в termux и установи контейнер с убунтой
  • pkg update && pkg install resolv-conf proot proot-distro -y
  • proot-distro install ubuntu
  • proot-distro login ubuntu

Установка

@x1unix
x1unix / aptx.md
Created April 6, 2022 20:12
macOS | Enable AptX
  1. Launch Terminal on Mac.

  2. To enable aptX, type in the following command:

sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
  1. To enable AAC, type the following:
@x1unix
x1unix / churl.sh
Created September 20, 2022 15:13
CURL using Google Chrome
./Google\ Chrome --headless --disable-gpu --disable-logging --dump-dom http://google.com
@x1unix
x1unix / grab.php
Created December 9, 2016 10:58
Moonwalk Grabber
<?php
function grabPOST($url, $postDATA, $iOS = true) {
$ch = curl_init();
$ua = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25';
if ($iOS!==false) curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
@x1unix
x1unix / sysconf_dump.c
Last active July 18, 2022 09:49
sysconf_dump - Dump sysconf() values
#include <stdio.h>
#include <unistd.h>
#include <sys/sysctl.h>
#include <string.h>
#define SC_OPT(KEY) { .id = KEY, .label = #KEY }
typedef struct sc_opt {
int id;
char* label;
@x1unix
x1unix / app.swift
Created July 1, 2022 12:14
Swift Playgorund window
import AppKit
import PlaygroundSupport
import SwiftUI
@objc protocol _NSWindow {
var title: String? { get set }
var styleMask: UInt { get set }
func setFrame(_ frameRect: NSRect, display flag: Bool)
func center()
func makeKeyAndOrderFront(_ sender: Any?)
@x1unix
x1unix / codes.json
Created June 27, 2022 21:32
HTTP Status Codes
[
{
"code": "100",
"phrase": "Continue",
"type": "Continue"
},
{
"code": "101",
"phrase": "Switching Protocols",
"type": "SwitchingProtocols"
@x1unix
x1unix / gfcommit.py
Created June 21, 2022 21:20
Git flow commit message generator
#!/usr/bin/env python3
# brew install pygit2
# pip3 install pygit2
from pygit2 import Repository
import sys
import re
regex = r"^([a-z]{1,5})/([A-Z]{1,5}-[0-9]{1,4})"
@x1unix
x1unix / ip.sh
Created April 3, 2022 23:59
Get public IP from terminal
curl -i https://cloudflare.com/cdn-cgi/trace | grep ip | awk -F'=' '{print $2}'