Skip to content

Instantly share code, notes, and snippets.

View timkinnane's full-sized avatar

Tim Kinnane timkinnane

View GitHub Profile
@mikaelmello
mikaelmello / draft.md
Last active April 25, 2018 17:01
Draft of GSoC 2018 proposal for Rocket.Chat

"Improve the integration of bots on Rocket.Chat" proposal for Google Summer of Code 2018

Personal Details

@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
'use strict';
var https = require('https');
var PAGE_TOKEN = "EAAJ6****";
var VERIFY_TOKEN = "my_token******";
exports.handler = (event, context, callback) => {
// process GET request
if(event.params && event.params.querystring){
var queryParams = event.params.querystring;
var rVerifyToken = queryParams['hub.verify_token']
@ishanbakshi
ishanbakshi / parrotMessengerBot.js
Created July 29, 2016 13:18
A lambda function that acts like an fb messenger bot which pings back what you typed
'use strict';
console.log('Loading function');
var https = require('https');
var PAGE_TOKEN = "EAASI6Z**********<fb tokenKey>";
var VERIFY_TOKEN = "my_awesome_token";
/**
* Provide an event that contains the following keys:
*
@willwhitney
willwhitney / himawari.py
Last active November 30, 2022 17:47 — forked from celoyd/hi8-fetch.py
Fetch and untile tiled Himawari-8 images from the http://himawari8.nict.go.jp PNG endpoint, then set them as desktop background on OSX
import requests
import sys
from datetime import datetime, timedelta
import pytz
from PIL import Image
from StringIO import StringIO
import os
import logging
# python himawari.py
@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@robmiller
robmiller / wp-audit
Last active June 26, 2017 23:33
wp-audit — a script that searches for WordPress installs on disk, and tells you: whether WordPress is out-of-date; whether any of the plugins you're using are out-of-date; and whether any of the core WordPress files have been tampered with. Requires Ruby 2.0+
#!/usr/bin/env ruby
# Usage: wp-audit [options]
# -a, --all-plugins Show all plugins, not just outdated ones
# -c, --[no-]color Highlight outdated versions in colour
# -f, --format [format] Specify output format. Accepted values: html, term (Terminal output and colours), md (Markdown, no colours). term is default.
#
# Requires: Ruby >= 2.0; a Unix-like operating system (one that ships
# with `find`, `less`, and `diff`)
#
# Installation:
@sebastianzillessen
sebastianzillessen / print-broadcasts.js
Created April 14, 2015 14:56
AngularJS decorator to display all $emit and $broadcast events of an application.
angular.module('print-broadcasts', []).config(['$provide', function ($provide) {
$provide.decorator('$rootScope', function ($delegate) {
var _emit = $delegate.$emit;
var _broadcast = $delegate.$broadcast;
$delegate.$emit = function () {
console.log("[$emit] " + arguments[0] + " (" + JSON.stringify(arguments) + ")");
return _emit.apply(this, arguments);
};
@dannyockilson
dannyockilson / gist:52a444195f0df873cc1c
Created March 13, 2015 17:11
Simple Angular Service for WordPress
'use strict';
angular.module('wordpress', [])
.service( 'wpService',
function($http, $q){
var url = 'http://allin.local/wp-json/';
return({
@timkinnane
timkinnane / dynamic_image_downsize.php
Created February 2, 2015 08:49
Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes. Long description in php doc block.
<?php
/**
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes.
*
* <p>Because Wordpress generates all image sizes on first upload, if you change
* theme or size settings after the upload, there won't be a matching file for
* the requested size.<br/>
* This filter addresses the problem of the default downsize process laoding
* a large file and scaling it down in the browser if it doesn't find the right
* size image. This can cause large files to be loaded unnecessarily and will