Skip to content

Instantly share code, notes, and snippets.

View Gregwar's full-sized avatar

Grégoire Passault Gregwar

View GitHub Profile
<?php
class A
{
public function __toString()
{
$x = new A;
htmlspecialchars($x);
}
};
@Gregwar
Gregwar / gist:6728800
Created September 27, 2013 13:44
def & extends
/**
* def & extends
*/
Object.prototype.def = function(variables) {
for (k in variables) {
this.prototype[k] = variables[k];
}
}
@Gregwar
Gregwar / battery.sh
Last active December 21, 2015 14:28
Small script for getting battery state on the Debian image of the ICOO D50 lite low-cost tablet
#!/bin/bash
# Get the current status & voltage
STATUS=`cat /sys/class/power_supply/battery/status`
PERCENT=`cat /sys/class/power_supply/battery/capacity`
echo "$STATUS $PERCENT%"
f:
pushl %ebp
movl %esp, %ebp
pushl %ebx
xorl %ebx, %ebx
subl $4, %esp
cmpl $9, 8(%ebp)
jle .L7
.p2align 4,,7
.p2align 3