View alive.go
// usage: ./main [PROCESS-ID] | |
package main | |
import ( | |
"fmt" | |
"time" | |
"os" | |
"strconv" | |
"github.com/shirou/gopsutil/process" | |
) |
View endless.go
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
ms, _ := time.ParseDuration("10ms") | |
for { |
View ProcessEnd.cs
// purpose: detect process end | |
// demo: | |
// - launch firefox | |
// - launch this program | |
// - close firefox and see 'died' | |
// notes: | |
// - may need sudo on *nix systems | |
using System; | |
using System.Diagnostics; |
View settings_vscode.json
{ | |
"terminal.integrated.rendererType": "dom", | |
"python.pythonPath": "/usr/local/opt/python/bin/python3.7", | |
"window.zoomLevel": 0, | |
"workbench.startupEditor": "none", | |
"[python]": { | |
"editor.rulers": [ | |
72, 79 | |
], |
View toggle_codelens.json
// extension: marketplace.visualstudio.com/items?itemName=rebornix.toggle | |
// usage: add to keybindings.json | |
[ | |
{ | |
"key": "cmd+alt+l", | |
"command": "toggle", | |
"when": "editorTextFocus", | |
"args": { | |
"id": "codeLens", | |
"value": [ |
View dynamic.py
import sys | |
def say_something(text): | |
print(f'I say: {text}...') | |
class simple: | |
def hello(self, text): | |
print(f'Hello, {text}!') | |
@staticmethod | |
def hello_again(text): |
View vscode_terminal.json
{ | |
"terminal.integrated.fontFamily": "Monaco", | |
"terminal.integrated.fontSize": 12, | |
"terminal.integrated.lineHeight":1 | |
} |
View wordify.py
import re | |
def wordify(text): | |
words = [] | |
matches = re.findall(r'(\b[^\s]+\b)', text) | |
if matches: | |
for word in matches: | |
words.append(word) | |
return words |
View fbscrap_getIDs.py
""" | |
fbscrap_getIDs.py: | |
Used to gather real Facebook profile IDs (https://github.com/gsscoder/facebook-snooper/). | |
For version: 0.4.3 | |
Usage: python3 fbscrap_getIDs output_file.txt | |
""" | |
import requests | |
import json | |
import sys |
View fbscrap_5random-2.py
""" | |
fbscrap_5random-2.py: | |
Demonstrates facebook_snooper package (https://github.com/gsscoder/facebook-snooper/). | |
For version: 0.4.3 | |
Usage: python3 fbscrap_5random-2 | |
""" | |
import requests | |
import json | |
import sys |
NewerOlder