This file contains hidden or 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
.loading { | |
background: url(https://a-v2.sndcdn.com/assets/images/loader-db80c5.gif) no-repeat center center; | |
clear: both; | |
text-align: center; | |
height: 40px; | |
width: 100%; | |
} |
This file contains hidden or 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 final class AndroidContext { | |
private static Context context; | |
public static Context getContext() { | |
return context; | |
} | |
public static void setContext(Context context) { | |
AndroidContext.context = context; |
This file contains hidden or 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 timeit import default_timer as timer | |
start = timer() | |
# long operation here | |
duration = timer() - start | |
print "Duration", duration |
This file contains hidden or 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
window.onerror = (msg, file, line, column, error=null)=>{ | |
try{ | |
if(error){ // error param not supported everywhere | |
msg = error.stack; | |
} | |
ga('send','event','error', `${file}:{line}`, msg) | |
}catch(e){ | |
// no-op |
This file contains hidden or 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
#!python | |
def savitzky_golay(y, window_size, order, deriv=0, rate=1): | |
r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter. | |
The Savitzky-Golay filter removes high frequency noise from data. | |
It has the advantage of preserving the original shape and | |
features of the signal better than other types of filtering | |
approaches, such as moving averages techniques. | |
Parameters | |
---------- | |
y : array_like, shape (N,) |
This file contains hidden or 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
/* | |
problema de la entrevista que mencioné en el último podcast: | |
https://soundcloud.com/sin-humo/entrevistas-de-trabajo-y-111mil | |
la idea es crear la función 'deferred', que permita un comportamiento | |
similar a lo que serían promises de javascript. | |
el deferred puede 'resolverse' con un valor cualquiera, o con otro 'deferred'. | |
en el segundo caso, el próximo `then` debería "esperar" también a este. |
This file contains hidden or 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
# Install the Python Requests library: | |
# `pip install requests` | |
import requests | |
def send_request(): | |
# My API | |
# GET https://api.invertironline.com/api/micuenta/estadocuenta |
This file contains hidden or 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 os | |
def get_filepaths(directory): | |
""" | |
This function will generate the file names in a directory | |
tree by walking the tree either top-down or bottom-up. For each | |
directory in the tree rooted at directory top (including top itself), | |
it yields a 3-tuple (dirpath, dirnames, filenames). | |
""" | |
file_paths = [] # List which will store all of the full filepaths. |
This file contains hidden or 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 <string> | |
#include <cstdio> | |
#include <iostream> | |
#include <map> | |
#include <vector> | |
#include <boost/algorithm/string.hpp> | |
#include <array> | |
using namespace std; | |
using namespace boost; |
This file contains hidden or 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
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://fb.me/react-15.1.0.js"></script> |
OlderNewer