Skip to content

Instantly share code, notes, and snippets.

@sunny
sunny / gist:7375
Created August 26, 2008 22:45
Translates aptitude/apt-get commands to archlinux's pacman/yaourt
#!/usr/bin/ruby
# Fake aptitude or apt-get cli so that:
# aptitude install rhythmbox-applet
# Gets translated to:
# yaourt -S rhythmbox-applet
ARGV[0] = case ARGV[0]
when 'update': '-Sy'
when 'install', 'reinstall': '-S'
when 'search': '-Ss'
@zester
zester / main.cpp
Created August 29, 2011 03:46
Skia Graphics Library Example (Note: Use to work)
#include "SkCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkString.h"
#include "SkTemplates.h"
int main (int argc, char * const argv[]) {
//
SkAutoGraphics ag;
@josch
josch / debconf-selections.txt
Created November 11, 2011 09:49
debconf installer preseed
# Services to use:
# Choices: security updates (from security.debian.org), volatile updates (from volatile.debian.org)
apt-setup-udeb apt-setup/services-select multiselect
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Check the integrity of another CD-ROM?
d-i cdrom-checker/nextcd boolean false
# Install GRUB?
grub-installer grub-installer/grub_not_mature_on_this_platform boolean false
@dabrahams
dabrahams / constexpr_demo.cpp
Created December 11, 2011 01:29
Fun with C++11 constexpr
#include <iostream>
#include <iomanip>
//
// Utilities
//
// RETURNS() is used to avoid writing boilerplate "->decltype(x) { return x; }" phrases.
//
// USAGE: auto function(<arguments>) RETURNS(<some-expression>);
//
@SkyM
SkyM / pre-commit
Created January 19, 2012 17:57
git pre-commit hook to stop bad words
#!/usr/bin/env ruby
FORBIDDEN = [
/\bdebugger\b/,
/\bfuck\b/,
/\bshit\b/,
/\bbitch\b/,
/\bwtf\b/,
/\bconsole\.debug\b/,
/\bLorem\.ipsum\.dolor\.sit\.amet\b/,
@atomize
atomize / iosCSS.html
Created March 1, 2012 07:59
iOS icon in pure CSS3 (with rando cool CSS image in background :-)
<style>
.icon {
background: #33CC00;
background-image:url(http://www.cyberdesignz.com/blog/wp-content/uploads/2009/12/CSS.png);
background-repeat:no-repeat;
background-position:center;
background-size:100%;
width: 128px;
height: 128px;
border-radius: 19px;
@jefftrull
jefftrull / js_spirit2.cpp
Created April 8, 2012 00:49
Attempted solution to "Boost Spirit vs. Flex/Bison" comparison
// Attempt at making a Boost grammar that successfully parses Jason Shankel's predicate logic language
// #define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/variant/recursive_variant.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/optional.hpp>
// start with the AST
@legnaleurc
legnaleurc / json.cpp
Created July 2, 2012 04:24
JSON parser with Boost Spirit
#include <boost/any.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/fusion/include/std_pair.hpp>
#include <vector>
#include <map>
#include <iostream>
namespace json {
@PetePolash
PetePolash / CalculatorBrain.h
Created July 23, 2012 21:29
Code for Minimal Parentheses
//
// CalculatorBrain.h
// Calculator
//
// Created by Peter Polash on 7/2/12.
// Copyright (c) 2012 Share. All rights reserved.
//
#import <Foundation/Foundation.h>
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx