Skip to content

Instantly share code, notes, and snippets.

View greyblue9's full-sized avatar
A day of coding is never a waste. Take 100 lines daily for 10 years 💻 🌟

David Reilly greyblue9

A day of coding is never a waste. Take 100 lines daily for 10 years 💻 🌟
View GitHub Profile
@greyblue9
greyblue9 / get_lan_clients.js
Created February 2, 2014 15:18
<h1>Get LAN Clients<h1> <h2>A NodeJs-based command-line utility</h2> &copy; 2014 by David Reilly <hr/> Name of file: <span style="font-style: monospace">get_lan_clients.js</span>
/**
*
* get_lan_clients.js
*
* Outputs a parser-friendly list of LAN clients known by the local router.
*
* Dependencies:
* "request" module
* - install by issuing command 'npm install request'
*
@greyblue9
greyblue9 / Google (Now) Search results activity on Android
Created August 10, 2014 00:46
Package and component activity that shows the actual search results from Google Now/Home Widget/Voice searches.
Package:
com.google.android.googlequicksearchbox
Component (activity):
com.google.android.velvet.ui.VelvetActivity
AKA
su -c am start -n com.google.android.googlequicksearchbox/com.google.android.velvet.ui.VelvetActivity
@greyblue9
greyblue9 / Gmail Search URL
Created August 10, 2014 00:50
URL straight to Gmail keyword search results (good for phones)
https://mail.google.com/mail/u/0/?shva=1#search/{query}
package com.isobar.operationlife.util;
import android.media.MediaRecorder;
import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by anitasantoso on 17/07/2014.
;-----------------------------------------
; Mac keyboard to Windows Key Mappings
;=========================================
; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
; ^ = CTRL
; + = SHIFT
; # = WIN
# EDITOR=vi
export EDITOR='vim'
export CLICOLOR=1;
export LSCOLORS=exfxcxdxbxegedabagacad;
PATH=.:~/bin:/usr/local/mysql/bin:/usr/local/bin:~/local/node/bin:$PATH
alias ll="ls -golAF"
alias lll="ls -lAF"
@greyblue9
greyblue9 / json2py.py
Created December 19, 2021 09:59
JSON to Python classes converter
#!/usr/bin/env python3
# Modified 2021-12-19 by @greyblue92
# - Convert from python 2 to python 3
# - Add API call to convert json to C#
# - Fix a bunch of problems with the python output
# - Type renaming and generics
# Original code from https://github.com/shannoncruey/csharp-to-python
########################################################################
# Apache License, Version 2.0 (the "License");
# the License.
@greyblue9
greyblue9 / Gmoney_123.html
Created April 13, 2022 04:08
HTML created by `markdown_py`
<h1>Thank you for using this library! Here are the basic ways to use it:</h1>
<h2>To import, do:</h2>
<blockquote>
<p>from G_Sketch import *</p>
</blockquote>
<h2>To create an object do:</h2>
<blockquote>
<p>my_sketch = Sketch("path/to/file.png")</p>
</blockquote>
<p>There are 3 functions for a sketch:</p>
#!/usr/bin/env python3
from datetime import datetime
from sys import argv
from bs4 import BeautifulSoup, GuessedAtParserWarning, Tag
from warnings import simplefilter
from urllib.request import Request, urlopen
from urllib.parse import quote_plus, urljoin
simplefilter(category=GuessedAtParserWarning,action="ignore")
query = " ".join(argv[1:]) if argv[1:] else "gif"
@greyblue9
greyblue9 / download_website_images.py
Last active May 30, 2022 14:38
Download images from website using requests, lxml, bs4
import re
import bs4
import sys
import time
import random
import requests
import urllib.parse
import urllib.request
from urllib.error import HTTPError as UrllibHTTPError
from requests.exceptions import HTTPError