Skip to content

Instantly share code, notes, and snippets.

@summer-wu
summer-wu / bench.js
Created May 23, 2023 06:48
JSON.stringify() is 3x slower in jsc
function getRandomStringWithLength(l) {
let s = String(Math.random());
while (true) {
if (s.length >= l) {
return s.substring(0, l);
}
s += ':' + String(Math.random());
}
}
@summer-wu
summer-wu / bubble_sort.c
Created July 28, 2018 11:36
两种bubble_sort。bubble_Me是我写的,可以排序,但具体步骤和冒泡不同。bubble_online是网上找的
//
// main.m
// bubble
//
// Created by n on 28/07/2018.
// Copyright © 2018 summerwuOrganization. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
@summer-wu
summer-wu / tv_channel_question.md
Last active March 14, 2017 07:47
一道面试题

#程序设计题

SD卡里保存了一个浙江卫视的节目列表,保存为tvtime.json。现在我要找出下面两条信息

  1. 节目的平均时长
  2. 播出时长最接近平均时长的节目(包括节目名和播出时间)

要求:

  • 在页面上添加一个按钮,点击按钮后打印出我要的两条信息。
  • 只写出每个类的接口,包括类名、方法名、属性名。只要接口,不要实现!不要实现!不要实现!
@summer-wu
summer-wu / decrypt.sh
Last active November 14, 2016 12:35
decrypt all mobileprovision files
#!/bin/bash
#usagge:
#place this file at ~/Library/MobileDevice/Provisioning Profiles
#chmod +x ./decrypt.sh
#./decrypt.sh
i=1 #loop index
decryptPPFileCommand="security cms -D -i "
for ppfile in *.mobileprovision; do
@summer-wu
summer-wu / xxf.zsh-theme
Last active April 1, 2019 10:43 — forked from xfanwu/xxf.zsh-theme
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
@summer-wu
summer-wu / swaggerTest.yaml
Last active August 29, 2015 14:24
swaggerTest.yaml
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Jiaolian API
description: 叫练B端API
version: "1.0.0"
# the domain of the service
host: test.jiaolian.com
# array of all schemes that your API supports