Skip to content

Instantly share code, notes, and snippets.

#define yield() do { ... some stuff; return 1; } while(0)
#define call(fun) while (fun) yield()
int read_uint32(uint32_t *out) {
while (available < 4)
yield();
*out = ntohl(*(uint32_t*)buf);
return 0;
}
/* RTC on I2C2 */
&am33xx_pinmux {
bb_i2c2_pins: pinmux_bb_i2c2_pins {
pinctrl-single,pins = <
0x154 0x72 // P9.21 = i2c2_scl
0x150 0x72 // P9.22 = i2c2_sda
>;
};
};
function uf() {
z=2;f=0;
while [ $z -lt $1 -a $f -lt 3 ]; do
((f+=!($1%z++)));
done
[ $f -lt 3 ];
}
for x in `seq 2 99`; do
for y in `seq $((x+1)) $((100-x))`; do
#!/bin/sh
# usage: onchange [interval] "[command to monitor]" "[command to run]"
STATE=$(eval $2 | md5sum)
while true; do
sleep $1
NEWSTATE=$(eval $2 | md5sum)
if [ "$NEWSTATE" != "$STATE" ]; then
@abrasive
abrasive / gist:0026e3cec831f40f33db
Created December 27, 2015 11:24
HP 16602A ioscan
la:/usr/conf/gen> ioscan
H/W Path Class Description
===============================================
bc
8 bc Pseudo Bus Converter
8/0 ba PCI Bus Bridge - GSCtoPCI
8/0/15/0 instrument PCI(103c1650)
8/0/60 unknown Built-in Fire Extinguisher (huh?)
8/0/63 tty Built-in RS-232C
8/16 ba Core I/O Adapter
Justin Li, Ph.D.
AccuraScience, LLC
5721 Merle Hay Road, Suite #16B
Johnston, IA 50131
[1][logo.png]
string FixText(string src)
{
// problem : printf is causing an error if a value contains the char '%' (e.g. 10k/1%)
// solution : '%' is substituted with '_'
string tarray[];
strsplit(tarray,src,'%');
return strjoin(tarray,'_');
}
@abrasive
abrasive / flow.py
Created May 16, 2016 23:52
goto has its place
# Find which column (if any) has doc IDs in it
for col in range(len(headers)):
for val in sheet.col_values(col, start_rowx=1):
if not isinstance(val, str):
continue
if doc_id_regex.search(val):
break
else:
continue
Enter a short description of your email. View this message online
Good morning, guys!
We noticed that you are interested in gui client for redis database.We have offer for you, may be you will be interested in our project. Here is the link
FastoRedis . We offer modern powerful and comfortable decision. FastoRedis is better for developers because we are able to work with clusters , better for
admins , better for managers .
We have more than 10 000 users and good offers for companies.
So we will be glad to hear your feedback. Thank you for your time reading this email. Download
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info attempt registry request try #1 at 12:32:14 AM
npm http request GET https://registry.npmjs.org/archiver
npm info attempt registry request try #1 at 12:32:14 AM
npm http request GET https://registry.npmjs.org/async
npm info attempt registry request try #1 at 12:32:14 AM
npm http request GET https://registry.npmjs.org/basic-auth
npm info attempt registry request try #1 at 12:32:14 AM