Skip to content

Instantly share code, notes, and snippets.

View ycjcl868's full-sized avatar
:fishsticks:
Training model

Charles ycjcl868

:fishsticks:
Training model
View GitHub Profile
@data-enhanced
data-enhanced / mixins-multiple-transitions.less
Created February 25, 2013 15:44
LESS mixin to handle multiple CSS transitions together
// Handling Multiple Transitions
// http://stackoverflow.com/questions/5510568/multiple-properties-are-getting-treated-as-separate-arguments-in-mixins
.bitbr-transition(@value1,@value2:X,...)
{
@value: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`;
-webkit-transition: @value;
-moz-transition: @value;
-ms-transition: @value;
-o-transition: @value;
@ckunte
ckunte / eurl.py
Last active May 4, 2023 23:50
A reading list.
#!/usr/bin/env python
# encoding: utf-8
"""
eurl.py extracts all URLs (one per line) from the OPML file or URL. [I needed
this script produce a list of feed URLs so I could manually enter these RSS
feeds in the new Reeder 2 for iOS.]
Acknowledgement: Special thanks to Kurt McKee ( http://kurtmckee.org/ ) for the
script: http://stackoverflow.com/a/7782782
"""
@sausman
sausman / CyaSS.jsx
Created February 21, 2015 22:13
CyaSS React Component - mimic :hover and :active with inline styles
import React from "react/addons";
import m from "./m";
// https://www.youtube.com/watch?v=GOiVYbWJDOA
export default class CyaSS extends React.Component {
constructor() {
super();
this.state = {
hover: false,
active: false
@kevinkindom
kevinkindom / Python Socket 编程详细介绍.md
Last active June 17, 2024 06:48
Python Socket 编程详细介绍

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active July 22, 2024 13:32 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@gchina
gchina / funclog.py
Created February 27, 2017 01:29
A decorator that provides input/output debug logging for function calls.
"""
This module provides a decorator that can be added to any function to provide
debug output that shows the values of the arguments passed in as well as the
return value. If a Logger object is passed in to the decorator, all debug
output will go to that Logger object. Otherwise, the output will go to the
default Logger object.
Tip: If using the default Logger object, don't forget to set the logging level
to DEBUG if you want to see output on stdout.
@braska
braska / index.pug
Last active September 25, 2022 16:55
Express React SSR
doctype html
<html !{helmet.htmlAttributes.toString()}>
head.
!{helmet.title.toString()}
!{helmet.meta.toString()}
!{helmet.link.toString()}
<body !{helmet.bodyAttributes.toString()}>
#root.
!{content}
script(src=assets['manifest.js'])
@gxcsoccer
gxcsoccer / class.js
Created February 2, 2018 09:46
各种类构造和继承性能比较
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
const util = require('util');
const assert = require('assert');
class A {
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active July 20, 2024 14:39
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).