This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macholib | |
def install_name_tool(fn, new_id=None, changedict=None): | |
m = macholib.MachO(fn) | |
if new_id: | |
m.rewriteInstallNameCommand(new_id) | |
if changedict: | |
m.rewriteLoadCommands(changedict) | |
m.save() | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
int test(int x, int y) { | |
return x + y - x * y; | |
} | |
int end() { | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import fnmatch | |
import os | |
import string | |
import subprocess | |
import sys | |
from collections import defaultdict | |
SUBSTS = set(['MOZ_PERMISSIONS', 'MOZ_DMD', 'HAVE_64BIT_BUILD', 'MOZ_CAN_RUN_PROGRAMS', 'MOZ_WIDGET_TOOLKIT', 'MOZ_PNG_ARM_NEON_CHECK', 'MOZ_ALLOW_HEAP_EXECUTE_FLAGS', 'AR_EXTRACT', 'TAR', 'MOZ_SERVICES_COMMON', 'MOZ_VPX_ERROR_CONCEALMENT', 'ZLIB_IN_MOZGLUE', 'MOZ_JPROF', 'MOZ_SOCIAL', 'NONASCII', 'MOZ_MULET', 'VPX_ASFLAGS', 'MOZ_APP_ID', 'MOZ_NO_EV_CERTS', 'MOZ_PNG_CFLAGS', 'MOZ_CHILD_PROCESS_NAME', 'MOZ_OPUS', 'OBJCOPY', 'ASM_SUFFIX', 'MOZ_WEBSPEECH', 'MOZ_FIX_LINK_PATHS', 'GRE_MILESTONE', 'HOST_LDFLAGS', 'VISIBILITY_FLAGS', 'TARGET_MD_ARCH', 'MOZ_ASAN', 'MOZ_APP_UA_NAME', 'GST_API_VERSION', 'MOZ_DEVICES', 'MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS', 'MOZ_SERVICES_HEALTHREPORT', 'MOZ_JPEG_CFLAGS', 'MOZ_B2G_FM', 'MOZ_B2G_RIL', 'MOZ_ANDROID_OMTC', 'MOZ_METRO', 'DSO_LDOPTS', 'MOZ_OPTIMIZE_LDFLAGS', 'MOZ_DISABLE_PARENTAL_CONTROLS', 'OS_LDFLAGS', '_MSC_VER', 'MKSHLIB_FORCE_ALL', 'MOZ_NUWA_PROCESS' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os, sys | |
import urllib, urllib2 | |
import json | |
import shutil | |
MOVIES = { | |
'title_prompt': "Search for a movie title (or type 'tv' to switch to TV Shows): ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Run this like: | |
# ircexport.py <email> <password> <log directory> | |
import requests | |
import json | |
import sys | |
from collections import deque | |
from concurrent.futures import ThreadPoolExecutor as Pool | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get(request): | |
debug_id = request.get('debug_id') | |
debug_filename = request.get('debug_filename') | |
if might_be_on_msdn(debug_id, debug_filename): | |
symbol_from_msdn = fetch_from_msdn(debug_id, debug_filename) | |
if not symbol_from_msdn: | |
raise PageNotFound() | |
else: | |
new_s3_key = upload_to_symbols_m_o_S3(symbol_from_msd) | |
return PageOK(new_s3_key.absolute_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::marker::PhantomData; | |
use std::boxed::Box; | |
trait Data { | |
fn get(&self) -> u32; | |
} | |
trait DataCreator { | |
fn new_data() -> Box<Data>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::slice::Iter; | |
use std::collections::HashSet; | |
trait EnumValues : Sized { | |
fn values() -> Iter<'static, Self>; | |
} | |
macro_rules! simple_enum { | |
($name:ident { $(($item:ident, $repr:expr),)* }) => { | |
#[derive(Debug)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"type": "object", | |
"description": "schema of a processed crash from Socorro", | |
"definitions": { | |
"frames": { | |
"type": "object", | |
"properties": { | |
"frame": { | |
"type": "integer", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::borrow::Cow; | |
use std::mem; | |
use std::ptr; | |
use std::slice; | |
#[derive(Clone)] | |
struct S { | |
pub x: u32, | |
} |
OlderNewer