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
""" | |
Use the following code in xcode preview to get the simulator path. Xcode preview does not support print or log to console. | |
So you need to use a `Text` view to show the path. | |
` | |
NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.applicationSupportDirectory, .userDomainMask, true) | |
` | |
""" | |
import pathlib | |
import subprocess |
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
#!/usr/bin/env bash | |
set -ex | |
# https://bogo.wtf/arm64-to-sim.html | |
ios_plat=ios | |
simulator_plat=simulator | |
make() { | |
for name in $@; do |
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
cache: | |
directories: | |
- $TRAVIS_BUILD_DIR/target | |
# https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci | |
- $HOME/Library/Caches/Homebrew | |
- /usr/local/Homebrew/ | |
# used in OSX custom build script dealing with local bottle caching | |
- $HOME/local_bottle_metadata | |
addons: | |
homebrew: |
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
extern crate bitcask_rs; | |
extern crate actix_web; | |
extern crate actix; | |
extern crate failure; | |
extern crate futures; | |
use failure::{Fail, Error}; | |
use futures::future::{Future, result}; | |
use actix_web::{server, App, HttpRequest, Responder, FutureResponse, HttpResponse, AsyncResponder}; | |
use std::path::PathBuf; |
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
// Copyright 2015, Google Inc. | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are | |
// met: | |
// | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. | |
// * Redistributions in binary form must reproduce the above |
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
class ImageDto(Model): | |
ident = StringType() | |
height = IntType() | |
width = IntType() | |
max_height = IntType() | |
max_width = IntType() | |
url_pattern = StringType() | |
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
impl ConnectionPool { | |
pub fn get_client<'a>(&'a self, addr: &str) -> Option<&'a rpc::Client> { | |
if let Some(&Ok(ref c)) = self.conns.get(addr) { | |
return Some(c); | |
} | |
let c = rpc::Client::new(addr); | |
self.conns.insert(addr.to_string(), c); | |
if let Some(&Ok(ref c)) = self.conns.get(addr) { |
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 subprocess | |
path = '/mfs/test/%d.xlsx' | |
def write(file_path): | |
from xlsxwriter import Workbook | |
wb = Workbook(file_path) | |
st = wb.add_worksheet('test') | |
for i in range(10): | |
st.write(i, i, 'aa') | |
wb.close() |
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
#include "tlpi_hdr.h" | |
int | |
main(int argc, char *argv[]) | |
{ | |
printf("Hello world\n"); | |
write(STDOUT_FILENO, "Ciao\n", 5); | |
if (fork() == -1) | |
errExit("fork"); | |
/* Both child and parent continue execution here */ |
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
#!/usr/bin/env python | |
import os | |
import requests | |
import time | |
import sys | |
from collections import namedtuple | |
LOGIN_PATH = 'http://www.ijiami.cn/toLogin' | |
UPLOAD_PATH = 'http://www.ijiami.cn/upload/' |
NewerOlder