Skip to content

Instantly share code, notes, and snippets.

Daniele Orru' danydev

Block or report user

Report or block danydev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ddoomm
ddoomm / Node-gyp compiling with xcode 10+ and osx 10.7+.md
Last active May 17, 2019
Node-gyp compiling with xcode 10+ and osx 10.7+
View Node-gyp compiling with xcode 10+ and osx 10.7+.md

Node-gyp compiling with xcode 10+ and osx 10.7+

The problem

On OSX 10.7+ and xcode 10+ I'm not able to install some project dependencies using npm.

NODE and NODE-GYP versions:

dom:~workspace/my_project$ nvm use 0.10.36
Now using node v0.10.36 (npm v2.15.1)
dom:~workspace/my_project$ node-gyp -v
@forairan
forairan / PhpJava.java
Last active Sep 13, 2019
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
View PhpJava.java
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@paulirish
paulirish / what-forces-layout.md
Last active Oct 16, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@steipete
steipete / CallOncePerRunloopHelper.m
Last active Feb 2, 2018
To work around rdar://19810773, I need a helper that can filter multiple calls to the same method during the same runloop. This is my first attempt on it.
View CallOncePerRunloopHelper.m
/// Performs `block` immediately and ignores subsequent calls during the same runloop.
#define pspdf_ensureCalledOnlyOncePerRunloop(block) do { \
static const char __onceKey; _pspdf_ensureCalledOnlyOncePerRunloop(self, &__onceKey, block); } while(0)
extern void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block);
void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block) {
NSCParameterAssert(block);
NSCParameterAssert(self);
PSPDFAssertOnMainThread(); // run loop needs the main thread.
@trusktr
trusktr / DefaultKeyBinding.dict
Last active Oct 11, 2019
My DefaultKeyBinding.dict for Mac OS X
View DefaultKeyBinding.dict
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@steipete
steipete / Warnings.xcconfig
Last active Mar 28, 2017
The warnings configuration we use in the PSPDFKit iOS framework - http://pspdfkit.com
View Warnings.xcconfig
//
// Warnings.xcconfig
//
// The list of warnings we (don’t) use, and the reasons why.
//
// :MARK: Warnings in use:
// :MARK: -everything
// We want the best possible diagnostics, so we simply enable everything that exists, and then opt–out of what doesn’t make sense for us.
//
// :MARK: - Warnings not to be promoted:
@staltz
staltz / introrx.md
Last active Oct 15, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
You can’t perform that action at this time.