Skip to content

Instantly share code, notes, and snippets.

View johannilsson's full-sized avatar

Johan Berg johannilsson

View GitHub Profile
var HID = require('node-hid');
var devices = HID.devices()
console.log(devices);
// Set path here.
var path = '';
var device = new HID.HID(path);
function Animal(name) {
this.name = name;
this.move = function() {
return this.name;
};
}
var a1 = new Animal('a');
var a2 = new Animal('a');
a1.move === a2.move
// false
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
echo "hello world"
?>
<p><?= $somevar ?></p>
<?php if (count($data) > 0): ?>
<ul>
<?php foreach($data as $row):?>
<li><?= $row ?></li>
<?php endforeach;?>
</ul>
<?php endif; ?>
cat ~/.bash_history |awk '{ print $1 }'|sort|uniq -c|sort -rn|head
# From http://ubuntuforums.org/showpost.php?p=4124372&postcount=5
mencoder -idx out.ogv -ovc lavc -oac mp3lame -o out.avi
Index: Zend/Soap/Wsdl.php
===================================================================
--- Zend/Soap/Wsdl.php (revision 14349)
+++ Zend/Soap/Wsdl.php (working copy)
@@ -182,12 +182,14 @@
$message = $this->_dom->createElement('message');
$message->setAttribute('name', $name);
+ $messageName = $name;
<?php
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
class MyClass {
/**
* This method takes ...
*
* @param integer $inputParam
* @return string
<?php
// Example tweets,
// Long message http://twitter.com/johantester/status/1364993887
// Normal message http://twitter.com/johantester/status/1364993866
class TwitterLogWriter extends Zend_Log_Writer_Abstract {
private $_twitter = null;
public function __construct($username, $password) {
$this->_twitter = new Zend_Service_Twitter($username, $password);