Skip to content

Instantly share code, notes, and snippets.

View zdne's full-sized avatar
💭
🚀

Z zdne

💭
🚀
View GitHub Profile
@zdne
zdne / gist:6366103
Created August 28, 2013 13:31
Install GCC 4.7 on Ubuntu Precise
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.7 g++-4.7
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
$ sudo update-alternatives --config gcc
@n-b
n-b / NBResponderChainUtilities.h
Last active August 3, 2021 10:08
Chain Responder Debugging Methods
//
// NBResponderChainUtilities.h
//
// Created by Nicolas @ bou.io on 19/04/13.
//
#import <UIKit/UIKit.h>
@interface UIView (NBResponderChainUtilities)
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder
@matthewpalmer
matthewpalmer / gist:4603471
Last active December 11, 2015 12:49
how to hide the bottom bar of embedded Github Gists
.gist .gist-file .gist-meta {
display: none;
}
// Example of HTTP API documentation format based on Apiary blueprint
== transport | Transport system
Markdown description of an entity goes here.
== transport/cards | Customers' cards
@keyword [string] Keyword of a card
@bengfarrell
bengfarrell / randomcoords.cpp
Last active May 5, 2025 13:09
Random Coordinates C++ Node.JS AddOn
#include <node.h>
#include <v8.h>
#include <stdio.h>
#include <stdlib.h>
using namespace v8;
Handle<Value> getRandomCoords2D(const Arguments& args) {
HandleScope scope;
@fdr
fdr / build.sh
Created December 28, 2012 08:49
Building clang on Heroku
#!/bin/sh
set -ue
curl -qO http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
curl -qO http://llvm.org/releases/3.2/clang-3.2.src.tar.gz
curl -qO http://llvm.org/releases/3.2/compiler-rt-3.2.src.tar.gz
tar -zxf llvm-3.2.src.tar.gz
tar -zxf clang-3.2.src.tar.gz
tar -zxf compiler-rt-3.2.src.tar.gz
@TooTallNate
TooTallNate / gist:4021657
Created November 6, 2012 00:50
Fix v8.h warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persist ent<T>::New(v8::Handle<T>)'. See http://www.parashift.com/c++-faq-lite/where-to-put-inline-keyword.html
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index ddde388..e886314 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -323,7 +323,7 @@ template <class T> class Persistent : public Handle<T> {
* Creates an empty persistent handle that doesn't point to any
* storage cell.
*/
- inline Persistent();
+ Persistent();
@skyscribe
skyscribe / .gdbinit
Created October 30, 2012 03:04
GDB init file to print STL containers and data members
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@kevinswiber
kevinswiber / hal.json
Created July 7, 2012 14:56
JSON Siren vs. HAL Representations
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"find": { "href": "/orders{?id}", "templated": true }
},
"_embedded": {
"orders": [{
"_links": {
"self": { "href": "/orders/123" },