Skip to content

Instantly share code, notes, and snippets.

@gsscoder
gsscoder / fbscrap_5random.py
Last active November 23, 2019 05:23
Scrapes Facebook for 5 random persons in 5 random cities
"""
fbscrap_5random.py:
Demonstrates facebook_snooper package (https://github.com/gsscoder/facebook-snooper/).
For version: 0.3.5
Usage: python3 fbscrap_5random
"""
from facebook_snooper import Session
import requests
import json
@gsscoder
gsscoder / fbscrap_5random-2.py
Last active November 23, 2019 05:24
Scrapes Facebook for 5 random persons in 5 random cities (2)
"""
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
@gsscoder
gsscoder / fbscrap_getIDs.py
Last active November 23, 2019 05:26
Scrapes Facebook to gather profile IDs
"""
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
@gsscoder
gsscoder / wordify.py
Created November 23, 2019 07:42
Python function to split into words ignoring punctuation
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
@gsscoder
gsscoder / vscode_terminal.json
Created November 28, 2019 05:44
Settings to customize terminal of VSCode
{
"terminal.integrated.fontFamily": "Monaco",
"terminal.integrated.fontSize": 12,
"terminal.integrated.lineHeight":1
}
@gsscoder
gsscoder / dynamic.py
Last active December 6, 2019 09:48
Dynamic calls in Python
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):
@gsscoder
gsscoder / toggle_codelens.json
Last active June 12, 2020 09:37
Settings to switch codeLens on/off with toggle
// extension: marketplace.visualstudio.com/items?itemName=rebornix.toggle
// usage: add to keybindings.json
// note: use 'ctrl+alt+l' for Windows
[
{
"key": "cmd+alt+l",
"command": "toggle",
"when": "editorTextFocus",
"args": {
"id": "codeLens",
@gsscoder
gsscoder / settings_vscode.json
Last active August 19, 2020 15:39
VSCode User Settings
{
"terminal.integrated.rendererType": "dom",
"python.pythonPath": "/Users/coder/.pyenv/shims/python",
"window.zoomLevel": 0,
"workbench.startupEditor": "none",
"[python]": {
"editor.rulers": [
72, 79
],
@gsscoder
gsscoder / ProcessEnd.cs
Created December 13, 2019 10:53
Demonstrates how to detect end of a running process
// 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;
@gsscoder
gsscoder / endless.go
Last active December 20, 2019 06:27
Infinity loop written in Go to check CPU usage
package main
import (
"fmt"
"time"
)
func main() {
for {
time.Sleep(time.Second) // comment this to overload the CPU