Skip to content

Instantly share code, notes, and snippets.

View pastcompute's full-sized avatar
💯

Andrew pastcompute

💯
View GitHub Profile
@pastcompute
pastcompute / Compile VLC.md
Last active July 5, 2016 05:43
Compile VLC

Ubuntu

sudo apt-get -y install yasm  \
    libavcodec-dev libavformat-dev libswscale-dev \
    libxcb-shm0-dev libxcb-composite0-dev libxcb-xv0-dev \
    libgcrypt20-dev libqt4-dev
@pastcompute
pastcompute / amdnode.js
Created June 26, 2016 09:56
not quite UMD AMD thing
(function(root,factory) {
if (typeof define === 'function' && define.amd) { define(['underscore'], factory); }
else if (typeof exports === 'object') { module.exports = factory(require('underscore')); }
else { root.returnExports = factory(root.underscore); }
}(this, function(_) {
'use strict';
return {
// thing public interface
};
}));
@pastcompute
pastcompute / Windows JS development.md
Last active December 2, 2016 12:43
Windows dev environment notes
@pastcompute
pastcompute / Stuff.md
Last active July 24, 2016 09:13
Javascript annoyances

Debugging Requirejs

{"requireType":"scripterror","requireModules":["galleria"],"originalError":{"isTrusted":true}} main.js:30:3
Error: Script error for "galleria", needed by: app
http://requirejs.org/docs/errors.html#scripterror

The error occurs for a variety of reasons, but with no actual useful detail.

@pastcompute
pastcompute / gist:9f0950bc9b45b8068fd9adf117fb31f9
Created May 24, 2016 07:37
Crazy Javascript tools #1 - grunt copy
This works as intended:
```
updcss: {
files:[
{
cwd: 'deps/pure',
expand: true,
nonull: true,
flatten: true,
src: '**/*.css',
@pastcompute
pastcompute / Another GDrive mail merge.gs
Created April 20, 2016 04:58
Another GDrive mail merge
function myFunction() {
var startRow = 2; // First row of data to process
var numRows = 16; // Number of rows to process
//startRow = 13;
//numRows = 1;
var sheet = SpreadsheetApp.getActiveSheet();
// Columns expected: Name, Extended Price, Email1, Email2, Purchase Order
var files = DriveApp.getFilesByName("EXAMPLE TAX INVOICE.docx");
@pastcompute
pastcompute / notes.md
Created April 19, 2016 11:19
Adafruit Nokia 5110 LCD notes

Contrasty option that worked:

  //My pins on teensy 32
  Adafruit_PCD8544 display = Adafruit_PCD8544(2, 3, 9, 20, 10);


  display.begin(45, 3);
  // and comment this out --> //  display.setContrast(45);
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 2; // Number of rows to process
// Fetch the range of cells A2:B3
var dataRange = sheet.getRange(startRow, 1, numRows, 2) // r, c, NR, NC
// Fetch values for each row in the Range.
var data = dataRange.getValues();
@pastcompute
pastcompute / gcode.gs
Created April 6, 2016 02:26
Google sheets script get list of files in gdrive
function listFilesInFolder(id) {
var folder = DriveApp.getFolderById('MyFolderID');
var contents = folder.getFiles();
var file;
var name;
var sheet = SpreadsheetApp.getActiveSheet();
var date;
var size;
sheet.clear();
@pastcompute
pastcompute / mqttsn.md
Last active March 26, 2016 00:24
Some MQTT-SN flows
             Client              Gateway               Broker
                |                   |                    |      
   PUBLISH() -->| --- SERCHGW ----> |                    |  
                | <-- GWINFO  ----- |                    |  
                | --- CONNECT ----> |                    |  
                | <--WILLTOPICREQ-- |                    |  
                | --- WILLTOPIC --> |                    |  
                | <-- WILLMSGREQ -- |                    |  

| --- WILLMSG ----> | ---- CONNECT ----> |(accepted)