Skip to content

Instantly share code, notes, and snippets.

@tareko
tareko / Notes
Created March 25, 2017 13:47
Build instructions for otoscope
lens_assy_v1 rotate -70 around Y
pin_v1: rotate +90 around X; scale 96%
specula: rotate +90 around Y
t-mounting: rotate 180 around X
body_nut_v1: scale 104%
others: rotate -90 around X
@tareko
tareko / base.html
Created March 10, 2017 11:25
HTML5 import
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.3.3/platform.js"></script>
<link rel="import" href="messages.html"/>
</head>
<body>
<h2>title</h2>
<script>
alert("document "+document);
@tareko
tareko / gist:ec953f75b8794d07b438b93ec687d944
Created August 12, 2016 17:11
Working keyvalueBehaviour.php
<?php
/**
* Copyright 2009 - 2013, Cake Development Corporation (http://cakedc.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2009 - 2013, Cake Development Corporation (http://cakedc.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
@tareko
tareko / EEprom settings
Created July 26, 2016 01:44
EEprom settings
>>> M503
SENDING:M503
echo:Steps per unit:
echo: M92 X80.00 Y80.00 Z4000.00 E152.00
echo:Maximum feedrates (mm/s):
echo: M203 X1000.00 Y1000.00 Z2.80 E25.00
echo:Maximum Acceleration (mm/s2):
echo: M201 X3000 Y3000 Z100 E10000
echo:Accelerations: P=printing, R=retract and T=travel
echo: M204 P1000.00 R3000.00 T1000.00
@tareko
tareko / error.txt
Created July 13, 2016 19:04
Error when trying to compile stethoscope
orangey@orangey:~/workspace/Stethoscope/source_files/stethoscope_head$ ruby sthoscope_head.rb
workspace/Stethoscope/source_files/stethoscope_head/lib/assemblies/upper_harness_assembly.rb:6:in `show': uninitialized constant UpperHarnessAssembly::BigTube (NameError)
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:631:in `block in save_all'
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:626:in `each'
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:626:in `save_all'
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:607:in `block in save!'
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:607:in `map'
from /var/lib/gems/2.3.0/gems/crystalscad-0.6.4/lib/crystalscad/CrystalScad.rb:607:in `save!'
from stethoscope_head.rb:18:in `<main>'
@tareko
tareko / plugin.rb
Last active June 20, 2016 00:15
Sample plugin text - not working
# name: replyto-individual plugin
# about: A plugin that allows exposure of the sender's email address for functionality
# similar to GNU/Mailman's Reply_Goes_To_List = Poster
# version: 0.0.1
# authors: Tarek Loubani <tarek@tarek.org>
# license: aGPLv3
PLUGIN_NAME ||= "replyto-individual".freeze
require 'email/message_builder.rb'
@tareko
tareko / httpsocket.php
Last active May 19, 2016 09:01
HTTPSocket for login against REST
<?php
$HttpSocket = new HttpSocket();
// Set data
$data = array(
'username' => 'username',
'password' => 'password'
);
@tareko
tareko / drupal bootstrap.php
Last active May 16, 2016 05:37
Attempt to bootstrap Drupal
<?php
# Set username and password
$username = 'NAME';
$password = 'PASSWORD';
# Drupal Bootstrap code
define('DRUPAL_ROOT', '/var/aegir/platforms/drupal_7');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
# My attempt at injecting variables for multisite stuff to fit aegir
@tareko
tareko / controller.php
Created September 29, 2015 11:45
Controller code
function icsView() {
$masterSet = array();
if (strlen(strstr($this->request->referer(), 'wizard'))>0) {
$this->set('id', $this->request->params['named']['id']);
$this->render('ics_link');
}
if (isset($this->request->data['Shift'][0]['id'])) {
$this->request->params['named']['id'] = $this->request->data['Shift'][0]['id'];
@tareko
tareko / controller test.php
Created September 29, 2015 11:31
Failure of helper mock
public function testIcsViewId() {
$Shifts = $this->generate('Shifts', array(
'methods' => array(
'iCal'
)
));
App::uses('View', 'View');
App::uses('iCalHelper', 'View/Helper');
$View = new View();