Skip to content

Instantly share code, notes, and snippets.

View matrixfox's full-sized avatar

Matrixfox matrixfox

View GitHub Profile
@TechnologistAU
TechnologistAU / unifi.sh
Last active October 10, 2019 02:57
UniFi 5 Installation Script for Raspberry Pi
#!/bin/bash
################################################################################
#
# This script automates the installation of the UniFi controller software on the
# Raspberry Pi.
#
# http://www.technologist.site/ubnt
#
################################################################################
@ck196
ck196 / flirckr_search.py
Created January 27, 2016 04:29
Flick search api
# Using flickr_api to search and download images
# https://github.com/alexis-mignon/python-flickr-api/wiki/Tutorial
import flickr_api as f
f.set_keys(api_key = 'xxxxxxxxxxxxxxxxxxxxxxx',
api_secret = 'xxxxxxxxxxx')
auth = f.auth.AuthHandler()
w = f.Walker(f.Photo.search, tags="sumo")

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@matrixfox
matrixfox / fakemail.js
Last active August 29, 2015 13:57
You suck at social attacks.school
var nodemailer = require("nodemailer");
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport({
service: "Gmail",
auth: {
user: "*******************",
pass: "*******************"
}
});
@planetoftheweb
planetoftheweb / tweets_json.php
Created July 2, 2013 23:33
This gist will let you retrieve a series of tweets using the twitter v1.1 API. There's a few steps you have to do before you use this. 1. First, you need to go to http://dev.twitter.com/apps and create a new application. 2. You'll also need to download this library. https://github.com/themattharris/tmhOAuth (You only need the tmhOAuth.php file) …
<?php
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth
// Use the data from http://dev.twitter.com/apps to fill out this info
// notice the slight name difference in the last two items)
$connection = new tmhOAuth(array(
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '', //access token
@jelled
jelled / jQuery Instagram Demo
Last active February 10, 2025 17:29
Demo usage of jQuery Instagramhttps://github.com/potomak/jquery-instagram
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-instagram/0.2.2/jquery.instagram.min.js"></script>
</head>
<body>
<h1>jQuery Instagram Demo</h1>
@styledev
styledev / Parse Tweet Message to Link Entities
Last active March 24, 2016 16:24
This function will linkify your tweet messages from the Twitter API using include_entities=true
@mikejolley
mikejolley / functions.php
Last active June 19, 2023 03:10
WooCommerce - Show quantity inputs for simple products within loops.
<?php
/**
* Code should be placed in your theme functions.php file.
*/
add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
$html .= woocommerce_quantity_input( array(), $product, false );
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@nus
nus / gist:1289855
Created October 15, 2011 17:13
HTMLParserを使ったページタイトルの取得
from HTMLParser import HTMLParser
import urllib2
class GetTitle(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.title_flag = False
def handle_starttag(self, tag, attrs):
if tag == 'title':