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
from __future__ import division | |
from numpy.fft import rfft | |
from numpy import argmax, mean, diff, log, nonzero | |
from scipy.signal import blackmanharris, correlate | |
from time import time | |
import sys | |
try: | |
import soundfile as sf | |
except ImportError: | |
from scikits.audiolab import flacread |
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
<?php | |
// http://www.elasticsearch.com/docs/elasticsearch/rest_api/ | |
class ElasticSearch { | |
public $index; | |
function __construct($server = 'http://localhost:9200'){ | |
$this->server = $server; | |
} |
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 tornado.httpserver, tornado.ioloop, tornado.options, tornado.web, os.path | |
from tornado.options import define, options | |
define("port", default=8888, help="run on the given port", type=int) | |
class Application(tornado.web.Application): | |
def __init__(self): | |
handlers = [ | |
(r"/", HomeHandler), | |
(r"/upload", UploadHandler) |
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
// Provides a device_scale class on iOS devices for scaling user | |
// interface elements relative to the current zoom factor. | |
// | |
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari | |
// Copyright (c) 2010 37signals. | |
// Slightly optimized by Mathias Bynens <http://mathiasbynens.be/> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights |
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
#!/bin/bash | |
#Autor: fitorec <http://fitorec.wordpress.com/> | |
#Descripción: Detecta a los hosts conectados en nuestra red | |
#Requiere: nmap | |
# | |
#Atención: Lo único q requiere configurar es la interfaz en donde se desea escuchar | |
INTER='wlan0' | |
#Extraemos la configuración de la IP y mascara de red para usar con el nmap | |
CONFIG=`ip addr sh $INTER | grep -E -o "([0-9]+.){3}[0-9]+/[0-9]+" ` |
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
#!/bin/bash | |
#mishudark <mishudark@astrata.com.mx> <moonsadly@gmail.com> | |
#thanks ostermiller.org to amazing regex | |
# | |
# delete_comments.sh | |
# | |
# Copyright 2010 mishudark <mishudark@astrata.com.mx> <moonsadly@gmail.com> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
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
public class CloudkickAPI { | |
private static final String TAG = "CloudkickAPI"; | |
private static String API_HOST = "api.cloudkick.com"; | |
private static String API_VERSION = "1.0"; | |
private final String key; | |
private final String secret; | |
private final HttpClient client; | |
private SharedPreferences prefs = null; | |
public CloudkickAPI(Context context) throws EmptyCredentialsException { |
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
$bloque = (object) module_invoke('debate','block','view',6); | |
print theme('block',$bloque); |
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
from django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
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
# pagination.py | |
class Paginator(object): | |
def __init__(self, query, per_page): | |
"""Initialize a paginator. | |
Arguments: | |
- query -- queryset from pymongo or mongoengine | |
- per_page -- number of items per page |
OlderNewer