Skip to content

Instantly share code, notes, and snippets.

View erincandescent's full-sized avatar
💭
pondering the existence of this feature

Erin erincandescent

💭
pondering the existence of this feature
View GitHub Profile
This file has been truncated, but you can view the full file.
zlib1g
Reverse Depends: 0ad (>= 0.0.17-1)
Reverse Depends: aapt (>= 21-2)
Reverse Depends: abiword (>= 3.0.0-8+b1)
Reverse Depends: achilles (>= 2-8)
Reverse Depends: adonthell (>= 0.3.5-9)
Reverse Depends: advancecomp (>= 1.19-1)
Reverse Depends: advi (>= 1.10.2-2)
Reverse Depends: aegis (>= 4.24.3-3)
// Hello world
print "Hello world";
// Some maths
// assign min & max as module scope variables
max = {(a, b) ^a > b? a : b};
min = {(a, b) ^a < b? a : b};
// ^ means return
// a & b will be new local variables
@erincandescent
erincandescent / gist:3661195
Created September 6, 2012 23:17
C++ with
template<typename TObj, typename TFn, typename... TArgs>
typename std::result_of<TFn(TArgs...)>::type with(TObj&& obj_, TFn fn, TArgs... args)
{
TObj obj(std::move(obj_));
return fn(std::foward(args)...);
}
template<typename TMutex>
std::lock_guard<TMutex>&& locked(TMutex& mtx)
{
@erincandescent
erincandescent / gist:4522321
Created January 13, 2013 04:26
Notifico JIRA hook change proposal: don't display field updates when the value > 40 characters to prevent message truncation or channel flooding
Add:
def change_summary(field, value):
if len(value) < 40:
return '{0} set to "{1}"'.format(field, value)
else:
return '{0} updated'.format(field)
At notifico/services/hooks/jira.py line 178, change to:
if simplified['changes']:
changes = simplified['changes']
@
@ Exception table
@
.syntax unified
.section .exception_table
.globl __reset, __undefined, __svc, __pfabort, __dtabort, __irq
.align 2
ARM_FUNCTION __reset
blx _reset
template<typename T, T V>
class get_member;
template<typename Class, typename T, T Class::* Pointer>
class get_member<T Class::*, Pointer>
{
public:
inline T& operator()(Class& c)
{
return c.*Pointer;
@erincandescent
erincandescent / interfaces.py
Created March 31, 2013 00:49
Preliminary ActivityStrea.ms schema
from zope.interface import Interface
from zope import schema
class IMediaLink(Interface):
duration = schema.Int(required=False)
height = schema.Int(required=False)
width = schema.Int(required=False)
url = schema.URI(required=True)
class IObject(Interface):
@erincandescent
erincandescent / gist:5383092
Created April 14, 2013 15:22
Resource interface changes
/** REMOVED **/
OGRE_AUTO_MUTEX
Resource objects are no longer thread safe, except for getting their state
and reference counting
virtual void prepareImpl(void)
virtual void unprepareImpl(void)
virtual void prepare(bool backgroundThread = false);
virtual bool isPrepared(void) const
virtual void _firePreparingComplete(bool wasBackgroundLoaded);
static inline int disable_interrupts(void)
{
int r;
__asm__ __volatile__(
"pushfd;"
"cli;"
"pop %0;"
: "=mr"(r)
);
ARCH=$1
PREFIX="$2"
IFS=. read -a TRIPLE <<< "$IP"
GMP="gmp-5.0.5"
MPFR="mpfr-3.1.1"
MPC="mpc-0.9"
BINUTILS="binutils-2.22"
GCC="gcc-4.7.1"
LLVM="llvm-3.1"