Skip to content

Instantly share code, notes, and snippets.

Avatar

Cameron Moreau cameronmoreau

View GitHub Profile
@bryant988
bryant988 / zillow.js
Last active February 5, 2023 23:40
Zillow Image Downloader
View zillow.js
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@checco
checco / rw_ro_access.sql
Last active January 4, 2023 09:22 — forked from oinopion/read-access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
View rw_ro_access.sql
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
@allskyee
allskyee / opencv_webcam_multithread.py
Last active December 7, 2022 15:59
opencv python camera frame grab and display on different threads with safe synchronization
View opencv_webcam_multithread.py
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@mxstbr
mxstbr / Readme.md
Last active January 25, 2023 19:03
Enable tab completion for JSX with Emmet in Atom
View Readme.md

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@Tokuriku
Tokuriku / Count lines of code in Xcode project
Last active November 30, 2022 17:11 — forked from ccabanero/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
View Count lines of code in Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l
@torgeir
torgeir / react-scaled-file-upload.js
Created March 25, 2015 12:16
React scaled file upload
View react-scaled-file-upload.js
function resize (file, maxWidth, maxHeight, fn) {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (event) {
var dataUrl = event.target.result;
var image = new Image();
image.src = dataUrl;
image.onload = function () {
@joyrexus
joyrexus / README.md
Last active November 23, 2022 15:03
Form/file uploads with hapi.js
View README.md

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

@gabrielemariotti
gabrielemariotti / Readme.md
Last active December 22, 2022 09:40
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.
View Readme.md

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@mhartington
mhartington / CustomTheme
Last active December 8, 2018 20:35
If you want to make a custom theme for ionic, and are using scss, this is a base to get you started
View CustomTheme
//Custom Theme test
// Colors
// -------------------------------
$custom: #057b6c !default;
// Buttons
// -------------------------------
$button-custom-bg: $custom !default;