Skip to content

Instantly share code, notes, and snippets.

View scoinhawk's full-sized avatar

scoinhawk scoinhawk

View GitHub Profile
@maxcal
maxcal / gist:2947417
Created June 18, 2012 08:08
Simple Curl web scraper
<?php
/**
* @param string $url - the url you wish to fetch.
* @return string - the raw html respose.
*/
function web_scrape($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($ch);
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active June 28, 2024 18:01 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@vndmtrx
vndmtrx / subnet.py
Last active October 18, 2023 20:09
Python 3 simple subnet calculator
#!/usr/bin/env python3
# Use: ./subnet.py <ip/cidr>
# Alt: ./subnet.py <ip> <mask>
import sys
if __name__=="__main__":
addr = [0, 0, 0, 0]
mask = [0, 0, 0, 0]
cidr = 0
@arycloud
arycloud / app.py
Created June 9, 2020 16:32
The main app.py file which contains the API logic code with routes, views and main functions.
from flask import Flask, request, jsonify
import json
import sqlite3
app = Flask(__name__)
def db_connection():
conn = None
try: