Skip to content

Instantly share code, notes, and snippets.

View qya's full-sized avatar
:atom:
On Error

qya

:atom:
On Error
View GitHub Profile
@ThomasLeister
ThomasLeister / cloud-ubuntu-netplan-secondary-ip-static.md
Created May 25, 2018 08:30
Ubuntu netplan config for secondary ip address

In case there's already a DHCP config for netplan for the private IP address:

File: /etc/netplan/50-cloud-init.yaml

Contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
@noelvo
noelvo / download-multiple-files.js
Created December 6, 2015 23:22
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
@amurrell
amurrell / YouTubeAPI-v3.inc.php
Created June 2, 2015 21:29
YouTubeAPI - V3 - Search by Keyword for Videos
<?php
// Make your key https://console.developers.google.com
define('YOUTUBE_API_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXX');
class YouTubeAPI {
private $keyword="";
private $maxResults = 10;
private $order = "viewCount";
private $query = '';
private $data = '';
@achilles283
achilles283 / Publish to WP via cURL-XMLRPC
Created October 13, 2012 20:27
Publish a post to WordPress using cURL/XMLRPC
// http://www.catswhocode.com/blog/10-awesome-things-to-do-with-curl
function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8')
{
$title = htmlentities($title,ENT_NOQUOTES,$encoding);
$keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
$content = array(
'title'=>$title,
'description'=>$body,
'mt_allow_comments'=>0, // 1 to allow comments