This file contains hidden or 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
import json | |
from datetime import datetime | |
from pathlib import Path | |
import html | |
# --- Configuration --- | |
INPUT_JSON = "toby.json" | |
OUTPUT_HTML = "converted_bookmarks.html" | |
def escape(text): |
This file contains hidden or 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
import os | |
import shutil | |
from typing import Callable | |
def move_files(condition: Callable[[str], bool], source_path: str, destination_path: str): | |
os.makedirs(destination_path, exist_ok=True) | |
for filename in os.listdir(source_path): | |
if condition(filename): | |
source = os.path.join(source_path, filename) | |
destination = os.path.join(destination_path, filename) |
This file contains hidden or 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
gh repo list orgname --limit 1000 | while read -r repo _; do | |
echo "git clone --mirror [email protected]:$repo.git" | |
git clone --mirror [email protected]:$repo.git | |
# cd $repo.git | |
# git remote set-url origin [email protected]:orgname/$REPO.git | |
# git push --mirror | |
done |
This file contains hidden or 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
package com.payable.posutils; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; |
This file contains hidden or 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
gh repo list payable --limit 1000 | while read -r repo _; do | |
echo "git clone --mirror [email protected]:$repo.git" | |
git clone --mirror [email protected]:$repo.git | |
# cd $repo.git | |
# git remote set-url origin [email protected]:orgname/$REPO.git | |
# git push --mirror | |
done |
This file contains hidden or 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
let n = 100; | |
// 0, 1, 1, 2, 3, 5, 8, 13 until 100, 144 | |
let number1 = 0; | |
let number2 = 1; | |
let sum = 1; | |
while(number1 <= n) { |
This file contains hidden or 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
<?php | |
function barry($url) | |
{ | |
$file_contents = ''; | |
$user_agent = 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)'; | |
if (function_exists('curl_init')) { | |
try { | |
$ch = curl_init(); | |
$timeout = 30; | |
curl_setopt($ch, CURLOPT_URL, $url); |
This file contains hidden or 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
netstat -anp | |
netstat -tupn | grep -v '127.0.0.1' | wc -l |
This file contains hidden or 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
sudo visudo | |
$USER ALL=(ALL) NOPASSWD: ALL |
This file contains hidden or 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
du -s --inodes * | sort -n | |
find * -type f -mtime +0 | wc -l |
NewerOlder