This file contains 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/zsh | |
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3 | |
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13) | |
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery) | |
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist | |
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/* | |
# user |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Jigsaw puzzle</title> | |
<script type="text/javascript"> | |
function save(filename, data) | |
{ | |
var blob = new Blob([data], {type: "text/csv"}); |
This file contains 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
function string.fromhex(str) | |
return (str:gsub('..', function (cc) | |
return string.char(tonumber(cc, 16)) | |
end)) | |
end | |
function string.tohex(str) | |
return (str:gsub('.', function (c) | |
return string.format('%02X', string.byte(c)) | |
end)) |
This file contains 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
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
This file contains 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
float AngleToValid( float fAngle ) | |
{ | |
return fAngle - (int)floorf(fAngle / 360.0f) * 360; | |
} |
This file contains 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
unameh() | |
{ | |
echo "kernel-name: $(uname --kernel-name)" | |
echo "nodename: $(uname --nodename)" | |
echo "kernel-release: $(uname --kernel-release)" | |
echo "kernel-version: $(uname --kernel-version)" | |
echo "machine: $(uname --machine)" | |
echo "processor: $(uname --processor)" | |
echo "hardware-platform: $(uname --hardware-platform)" | |
echo "operating-system: $(uname --operating-system)" |
This file contains 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
@ECHO OFF | |
SETLOCAL ENABLEEXTENSIONS | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
CALL:wi_run_pageant | |
GOTO:EOF | |
::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: 工具函数 | |
::::::::::::::::::::::::::::::::::::::::::::::::::::: |
This file contains 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 | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains 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<time.h> | |
#include<stdio.h> | |
int main(void) | |
{ | |
clock_t ticks1, ticks2; | |
ticks1=clock(); | |
ticks2=ticks1; | |
while((ticks2-ticks1)/CLOCKS_PER_SEC<1) { |
This file contains 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
function time_t2calendartime(time) | |
return os.date("%Y-%m-%d %H:%M:%S", time) | |
end |
NewerOlder