Skip to content

Instantly share code, notes, and snippets.

View JimLiu's full-sized avatar
🐶
Yesterday is history, tomorrow is a mystery, and today is a gift

Jim Liu 宝玉 JimLiu

🐶
Yesterday is history, tomorrow is a mystery, and today is a gift
View GitHub Profile
@ninehills
ninehills / chatglm-openai-api.ipynb
Last active April 16, 2024 01:15
chatglm-openai-api.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stephancasas
stephancasas / AdvancedToolbarWindow.swift
Last active September 22, 2024 12:55
A SwiftUI-compatible window for macOS with advanced toolbar configurability.
//
// AdvancedToolbarWindow.swift
//
// Created by Stephan Casas on 3/17/23.
//
import SwiftUI;
import AppKit;
class AdvancedToolbarWindow<MainContent: View, ToolbarContent: View, TitleToolbarContent: View>: NSWindow, NSToolbarDelegate {
@EyMaddis
EyMaddis / hooks_mediaQueries_toString.ts
Created February 20, 2020 12:57
React Native for Web SSR Media Queries
export type DeviceSize = 'mobile' | 'small' | 'medium' | 'large'
export const deviceSize: { [key in DeviceSize]: [number, number] } = {
mobile: [0, 575],
small: [576, 767],
medium: [768, 991],
large: [992, 999999999],
}
@necolas
necolas / Composite-Link.js
Created September 19, 2018 23:02
Next.js links with React Native for Web
@cereallarceny
cereallarceny / index.js
Created October 12, 2017 20:37
Server-side rendering with create-react-app (Fiber), React Router v4, Helmet, Redux, and Thunk
// Ignore those pesky styles
require('ignore-styles');
// Set up babel to do its thing... env for the latest toys, react-app for CRA
require('babel-register')({
ignore: /\/(build|node_modules)\//,
presets: ['env', 'react-app']
});
// Now that the nonsense is over... load up the server entry point
@victorferreira
victorferreira / Making it Swift.swift
Last active July 29, 2024 03:01
Updating SQLite Tutorial code to Swift 3. See the tutorial at: https://www.raywenderlich.com/123579/sqlite-tutorial-swift
//: Back to [The C API](@previous)
import SQLite
import Foundation
import PlaygroundSupport
destroyPart2Database()
//: # Making it Swift

打印表头

小明正在用JavaScript写一个日志分析程序。该程序会将日志转化为CSV文件,以便在Excel等应用中加载为一个表格。现在他在生成表头上遇到了困难。

他需要实现如下一个方法:

function printLine(array) {
    console.log(array.join(","));
}
@vasanthk
vasanthk / System Design.md
Last active November 14, 2024 11:31
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.
@sr75
sr75 / osx-homebrew-setup.md
Last active June 18, 2020 06:35
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2