Skip to content

Instantly share code, notes, and snippets.

View dcpesses's full-sized avatar

Danny Pesses dcpesses

View GitHub Profile
# With a little help from http://www.raspberrypi.org/forums/viewtopic.php?f=78&t=85041
sudo raspi-config
# Expand Filesystem
# Advanced Options -> Audio -> Change to 3.5 Headphone
# Internationalisation Options
sudo reboot
# if locale errors show up,
sudo dpkg-reconfigure locales
# Uncheck en_UK.UT8
# Check en_US.UTF8
@lazywinadmin
lazywinadmin / gist:a1d8dfa9a0159d0dbe43
Created May 14, 2015 02:38
Get Office365 Calendar Items using REST API
Invoke-RestMethod -Uri ("https://outlook.office365.com/api/v1.0/users/sharedmailbox@domain.com/calendarview?startDateTime=" + (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddThh:mm:ssZ") + "&endDateTime=" + (Get-Date).ToUniversalTime().AddDays(7).ToString("yyyy-MM-ddThh:mm:ssZ")) -Credential (Get-Credential) | foreach-object{$_.Value}
@sgrebnov
sgrebnov / cordova-plugin-ms-outlook
Last active June 11, 2016 17:52
O365/Outlook Cordova Plugin sample code
var resourceUrl = 'https://outlook.office365.com';
var officeEndpointUrl = 'https://outlook.office365.com/ews/odata';
var TENANT_NAME = '17bf7168-5251-44ed-a3cf-37a5997cc451';
var appId = '3cfa20df-bca4-4131-ab92-626fb800ebb5';
var redirectUrl = "http://test.com";
var authUrl = 'https://login.windows.net/' + TENANT_NAME + '/';
var TEST_USER_ID = '';
@vimes1984
vimes1984 / contact form 7 to sales force
Last active September 20, 2016 00:22
this is an update to this function which is a little outdated now: http://daddyanalytics.com/integrating-contact-form-7-and-salesforce/
<?php
/**
* Sales force integration
*/
add_action( 'wpcf7_before_send_mail', 'my_conversion' );
function my_conversion( $cf7 ){
ob_start(); // start buffer capture
@velsa
velsa / gist:d0ba3b02514e302687cb
Created November 30, 2014 18:04
EventPlayer
/** @jsx React.DOM */
var EventPlayer = React.createClass({
componentDidUpdate: function() { this.update_player(); },
componentDidMount: function() {
var self = this;
self.update_player();
$(window).on('resize', function(){
self.resize_player();
});
@insin
insin / RegExp-findall.js
Created April 8, 2011 11:12
findAll method for RegExps with results in the vein of Python's re.findall
RegExp.prototype.findAll = function(str) {
var match = null, results = [];
while ((match = this.exec(str)) !== null) {
switch (match.length) {
case 1:
results[results.length] = match[0];
break;
case 2:
results[results.length] = match[1];
break;
@steveworkman
steveworkman / offline-analytics.js
Last active May 25, 2017 17:29
Attempt to turn the offline-analytics example into a re-usable bit of code that is also testable. Each function now uses promises to keep state
// IndexedDB properties
var idbDatabase;
const IDB_VERSION = 1,
STOP_RETRYING_AFTER = (1000 * 60 * 60 * 24), // One day, in milliseconds.
STORE_NAME = 'urls',
IDB_NAME = 'offline-analytics';
// These URLs should always be fetched from the server, or page views don't count!
const analyticsDomains = [
{ host: 'omniture.adobe.com', pathStart: '/b/ss'}, // Omniture
@offsky
offsky / NewMacConfig.md
Last active July 3, 2017 15:50
Setup new mac for web development (Updated for Yosemite)
@anaisbetts
anaisbetts / analytics.js
Created January 7, 2015 20:47
Google Analytics in Atom Shell
// Pretend that cookies work
(function (document) {
var cookies = {};
document.__defineGetter__('cookie', function () {
var output = [];
for (var cookieName in cookies) {
output.push(cookieName + "=" + cookies[cookieName]);
}
return output.join(";");
});
@qknow-w
qknow-w / react-videojs-es6.js
Created August 28, 2016 12:55
react-videojs-es6
import React, {Component} from "react";
import cx from 'classnames';
import vjs from 'video.js';
import _ from 'lodash';
import ReactDOM from 'react-dom';
const DEFAULT_HEIGHT = "100%";
const DEFAULT_WIDTH = "100%";
const DEFAULT_ASPECT_RATIO = (9 / 16);
const DEFAULT_ADJUSTED_SIZE = 0;