Skip to content

Instantly share code, notes, and snippets.

View reuben's full-sized avatar
🌠

Reuben Morais reuben

🌠
View GitHub Profile
dictionary ContactFieldInitializer {
sequence<DOMString>? type;
DOMString? value;
};
[Constructor(sequence<DOMString> type, DOMString value, boolean pref),
JSImplementation="@mozilla.org/contactField;1"]
interface ContactField {
attribute any type;
attribute DOMString? value;
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const DEBUG = true;
function debug(s) { dump("-*- ContactManager: " + s + "\n"); }
const Cc = Components.classes;
#if defined(WIN32)
#include <shellapi.h>
#elif defined(__APPLE__)
#include <Foundation/NSString.h>
#include <AppKit/NSWorkspace.h>
#else
#include <unistd.h>
#endif
diff --git a/utils/Makefile b/utils/Makefile
index 9d4dc5c2..bb4be49 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -9,7 +9,7 @@
LEVEL = ..
PARALLEL_DIRS := FileCheck FileUpdate TableGen PerfectShuffle \
- count fpcmp llvm-lit not unittest
+ count fpcmp llvm-lit not
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
#include "AccessCheck.h"
#include "AtomList.h"
#include "ContactsBinding.h"
#include "EventHandlerBinding.h"
#include "EventTargetBinding.h"
#include "WrapperFactory.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMCursor.h"
@reuben
reuben / geoserver.js
Last active January 4, 2016 17:59
geoserver.js
var http = require('http');
var server = http.createServer(function (request, response) {
console.log("Serving request");
response.writeHead(200, {
"Cache-Control": "no-cache",
"Content-Type": "application/x-javascript",
});
var json = {
status: "OK",
@reuben
reuben / test.c
Created May 26, 2015 01:32
monitoria clandestina
#include <stdio.h>
int primo(int n) {
for (int i = 2; i < n-1; ++i) {
if (n % i == 0) {
return 0;
}
}
return 1;
}
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
@reuben
reuben / 1_rsa_encrypt.py
Last active May 17, 2016 22:33
RSA toy impl
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
def rand_prime(n):
n = n+1 if n % 2 == 0 else n
while True:
p = random.randrange(n, 2*n, 2)
if all(p % n != 0 for n in range(3, int((p ** 0.5) + 1), 2)):
curl -LO https://www.ldc.upenn.edu/sites/www.ldc.upenn.edu/files/ctools/sph2pipe_v2.5.tar.gz
tar xf sph2pipe_v2.5.tar.gz
pushd sph2pipe_v2.5
gcc -o sph2pipe *.c -lm
sudo cp sph2pipe /usr/bin
popd
rm -r sph2pipe_v2.5{,.tar.gz}