Skip to content

Instantly share code, notes, and snippets.

View l-7-l's full-sized avatar
😇
Focusing

Chenyang l-7-l

😇
Focusing
  • Beijing, Sino
  • 15:20 (UTC +08:00)
View GitHub Profile
@PlugFox
PlugFox / database.dart
Last active March 18, 2024 11:32
Key Value extension for SQLite (Drift)
import 'package:database/src/platform/io.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'package:database/src/platform/js.dart';
import 'package:database/src/queries.dart';
import 'package:drift/drift.dart';
import 'package:meta/meta.dart';
part 'database.g.dart';
/// Key-value storage interface for SQLite database
@rydmike
rydmike / main.dart
Last active December 23, 2022 12:22
Flutter width constrained body with app theming demo
// MIT License
//
// Copyright (c) 2021 Mike Rydstrom
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@vital-edu
vital-edu / main.dart
Last active February 17, 2024 09:15
How to overlap SliverList on a SliverAppBar
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'How to overlap SliverList on a SliverAppBar',
debugShowCheckedModeBanner: false,
@ddarkr
ddarkr / en-US.md
Last active December 16, 2020 03:47
Next.js: TypeScript + ESLint (@typescript-eslint) + Prettier 설정 (한국어는 영어 문서 아래에 있습니다)

😉 Next.js: TypeScript + ESLint (@typescript-eslint) + Prettier Setup

📅 Write: 2020/02/03

✅ Before you follow this tutorial, create the Next.js project first.

1. Set up TypeScript at your project.

Check Next.js TypeScript Document

@njmyers
njmyers / local.conf
Last active December 17, 2022 05:50
Use apple fonts as defaults for fontconfig users
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- pixel alignment rgba -->
<!-- check it here http://www.lagom.nl/lcd-test/subpixel.php -->
<match target="font">
<edit name="rgba" mode="assign">
<const>rgb</const>
</edit>
</match>
@ValentinFunk
ValentinFunk / NetlifyServerPushPlugin.js
Last active May 4, 2024 04:24
Webpack - Generate Netlify HTTP2 Server Push _headers File when using the HtmlWebpackPlugin
/**
* Generate a Netlify HTTP2 Server Push configuration.
*
* Options:
* - headersFile {string} path to the _headers file that should be generated (relative to your output dir)
*/
function NetlifyServerPushPlugin(options) {
this.options = options;
}

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 5, 2024 12:01
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@jamarparris
jamarparris / Generate Mongo Object ID in PostGres
Last active March 20, 2024 00:04
Create ObjectIds in PostGres following the MongoDB semantics. Very similar to the Instagram approach linked below.http://docs.mongodb.org/manual/reference/object-id/http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@suziewong
suziewong / git.md
Last active March 17, 2024 08:36
github的多人协作?how to 贡献代码?

github的多人协作

  1. github上你可以用别人的现成的代码 直接 git clone 即可了

  2. 然后你也想改代码或者贡献代码咋办?

Fork