Skip to content

Instantly share code, notes, and snippets.

@satyr
satyr / google++.ubiq.js
Last active March 12, 2022 18:06 — forked from satyr/google-keynav.ubiq.js
google++
Utils.extend(feed, {
title: 'google++',
author: {
name: 'satyr', email: 'murky.satyr\x40gmail.com',
homepage: 'http://satyr.github.com',
},
license: 'X',
})
const
Google = 'https://www.google.com/',
@rustyio
rustyio / subgit
Created January 24, 2010 18:48
subgit
#!/usr/bin/env sh
# subgit
#
# A tiny wrapper around git to help you manage
# Git sub-projects easily, safely, and simply.
#
# Created by Rusty Klophaus (@rklophaus)
#
# See http://rklophaus.com/subgit for usage.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb0f7f3..80c4c37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,18 +6,6 @@ endif(COMMAND cmake_policy)
# allow empty else and endif constructs (available by default since 2.6.0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
-# prevent in-source builds
-IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
@chenshuo
chenshuo / linux_com.h
Created March 12, 2011 10:14
If Linux kernel were exposed as COM interfaces
class Linux_0_01
{
int restart_syscall(); //0
int exit(); //1
int fork(); //2
int read(); //3
int write(); //4
int open(); //5
int close(); //6
int waitpid(); //7
@mbautin
mbautin / git-crosspick
Created September 30, 2011 23:05
Port git commits from one repository to another
#!/bin/bash
# Created by Mikhail Bautin on 09/30/2011.
#
# Copyright (c) 2011 Facebook Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@kishikawakatsumi
kishikawakatsumi / gist:2217051
Created March 27, 2012 15:32
Reflection C function call by ffcall
#include <stdio.h>
#include <dlfcn.h>
#include <avcall.h>
int main(int argc, char *argv[]) {
int ret;
av_alist alist;
void *dlh;
void *fp;
@DopefishJustin
DopefishJustin / clang.diff
Created April 9, 2012 18:56
Clang fixes for MAME
diff --git a/src/emu/device.h b/src/emu/device.h
index df101d9..a20d341 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -377,9 +377,10 @@ protected:
virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); }
// operators to make use transparent
- operator _PointerType *() { return m_target; }
operator _PointerType *() const { return m_target; }
@chobie
chobie / gist:2416534
Created April 18, 2012 21:04
installing php-git
sudo aptitude install build-essential automake cmake patch git-core php5-cli php5-dev libpcre3-dev -y
git clone https://github.com/libgit2/libgit2.git
cd libgit2
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --build . --target install
cd ../../
@alexpirine
alexpirine / endianness.c
Created June 15, 2012 15:06
Endianness conversions with positive integers
// converts 32-bits positive integer to 4-bytes little endian
void to4li(unsigned long int const value, char * const buffer)
{
buffer[0] = value >> 8 * 0;
buffer[1] = value >> 8 * 1;
buffer[2] = value >> 8 * 2;
buffer[3] = value >> 8 * 3;
}
// converts 16-bits positive integer to 2-bytes little endian