Skip to content

Instantly share code, notes, and snippets.

View azenla's full-sized avatar
🏳️‍⚧️
cabbit mode

Alex Zenla azenla

🏳️‍⚧️
cabbit mode
View GitHub Profile
@azenla
azenla / nginx.conf
Last active August 29, 2015 14:26 — forked from azet/nginx.conf
nginx/nessus ssl config
server {
listen 80;
server_name nessus.gmi.oeaw.ac.at;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
server_name nessus.gmi.oeaw.ac.at;
client_max_body_size 100m;
{
"requests": [
{
"method": "invoke",
"path": "/conns/etsdb/db/stats/%2Fconns%2FSystem%2FMemory_Usage/getHistory",
"params": {
"Timerange": "2015-07-19T17:27:00.000/2015-07-19T17:56:59.999",
"Interval": "2m",
"Rollup": "avg"
},
!/bin/bash
# travis_ssh_key_encrypt_for_mac.ssh
# Encrypts private SSH keys for use in .travis.yml.
# Based on the excellent linux version:
# https://gist.github.com/lukewpatterson/4242707
# Also see the travis documentation:
# http://docs.travis-ci.com/user/build-configuration/#Secure-environment-variables
# Usage:
# Go to your git project:
@azenla
azenla / honey.js
Last active August 29, 2015 14:21
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Javascript preamble, that lets the output of dart2js run on V8's d8 shell.
// Node wraps files and provides them with a different `this`. The global
// `this` can be accessed through `global`.
var self = this;
import "dart:async";
import "dart:io";
import "dart:math";
String generateToken(int length) {
var r = new Random();
var buffer = new StringBuffer();
for (int i = 1; i <= length; i++) {
if (r.nextBool()) {
String letter = alphabet[r.nextInt(alphabet.length)];
library manager;
import "dart:io";
import "package:irc/irc.dart" show Color;
import 'package:polymorphic_bot/api.dart';
BotConnector bot;
EventManager eventManager;
@azenla
azenla / pagerank.py
Last active August 29, 2015 14:06 — forked from diogojc/pagerank.py
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.
Future<String> getString(Uri uri) {
return new HttpClient().getUrl(uri)
.then((HttpClientRequest request) => request.close())
.then((HttpClientResponse response) => response.transform(UTF8.decoder).join());
}
part of dartboard;
class FutureGroup<E> {
Completer<E> _completer = new Completer<E>();
Set<Future<E>> _futures = new Set<Future<E>>();
bool add(Future<E> future) => _futures.add(future);
Future<List<E>> wait() {
Future.wait(_futures).then((result) => _completer.complete(result))
class FutureGroup {
Completer _completer = new Completer();
List<Future> _futures = new List<Future>();
FutureGroup();
bool add(Future future) {
if(!_futures.contains(future)) {
_futures.add(future);
return true;