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
<?hh | |
async function stream_check(resource $stream, string $mode, int $usec): Awaitable<void> | |
{ | |
$r = $w = $e = null; | |
do { | |
if ($mode == "r") { | |
$r = Vector{$stream}; | |
} |
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
#pragma mark - | |
#pragma mark UIApplication Delegate | |
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)pWindow { | |
UITabBarController *tabCtrl = (UITabBarController *)self.window.rootViewController; | |
//Check if there's a modal view controller on screen (dismissing modal view controllers are ignored) | |
if (tabCtrl.selectedViewController.presentedViewController && !tabCtrl.selectedViewController.presentedViewController.isBeingDismissed) { | |
return tabCtrl.selectedViewController.presentedViewController.supportedInterfaceOrientations; | |
} |
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 pandas as pd | |
data = {'a': [1, 3, 4, 4], 'b': [1, 3, 2, 3]} | |
df = pd.DataFrame(data=data) | |
df.to_csv("data/old_data.csv") | |
data2 = {'a': [1, 3, 5, 4], 'b': [1, 3, 2, 3]} | |
df2 = pd.DataFrame(data=data2) | |
df2.to_csv("data/new_data.csv") |
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 HTTP | |
import File | |
import HTTPSClient | |
import JSON | |
var url: String? | |
do { | |
let client = try! Client(uri: "https://api.github.com:443") | |
var response = try client.get("/repos/vsouza/awesome-ios/git/trees/HEAD") | |
let buffer = try response.body.becomeBuffer() |
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 os | |
import httplib | |
import tornado.web | |
class ErrorHandler(tornado.web.RequestHandler): | |
"""Generates an error response with status_code for all requests.""" | |
def __init__(self, application, request, status_code): | |
tornado.web.RequestHandler.__init__(self, application, request) | |
self.set_status(status_code) | |
Elixir Native UI - Boyd Multerer https://www.youtube.com/watch?v=77FW-jrCyCs
- Only dependencies are Elixir, Erlang, and glut to access OpenGL.
- No UI threads! Individual processes can be used to track mouse
- Slides track mouse as long as button is down https://youtu.be/77FW-jrCyCs?t=37m35s
- Sliders can be rotated https://youtu.be/77FW-jrCyCs?t=40m4s
- 500 lines animating still a few ms to render https://youtu.be/77FW-jrCyCs?t=43m34s
Thinking In Ecto - Darin Wilson https://www.youtube.com/watch?v=YQxopjai0CU
- Repository pattern https://youtu.be/YQxopjai0CU?t=2m12s
- Explicitness https://youtu.be/YQxopjai0CU?t=5m29s
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 concurrent.futures import ThreadPoolExecutor | |
from datetime import timedelta | |
from tornado import gen | |
from tornado.concurrent import run_on_executor | |
THREADPOOL_MAX_WORKERS = 10 | |
THREADPOOL_TIMEOUT_SECS = 30 | |
def onthread(function): |
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
# -*- coding:utf-8 -*- | |
''' | |
Simplistic script to parse the detailed AWS billing CSV file. | |
Script displays cost of S3 operations broken down per region, bucket and usage | |
type (either storage or network). It also sums up the amount of storage used per bucket. | |
Output is filtered wrt to costs < 1$. | |
See http://docs.aws.amazon.com/awsaccountbilling/latest/about/programaccess.html for | |
how to set up programmatic access to your billing. |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
OlderNewer