Skip to content

Instantly share code, notes, and snippets.

View liuliangsir's full-sized avatar
💻
Coding

流浪大法师 liuliangsir

💻
Coding
View GitHub Profile
@gaoconghui
gaoconghui / pdf_tripper.py
Last active March 9, 2025 07:15
删除pdf中指定的字(如水印 版权标记)
# -*- coding: utf-8 -*-
"""
给定一个pdf路径,以及一个列表,可修改pdf内容,删除所有符合条件的文字。
"""
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import TextStringObject, NameObject
from PyPDF2.pdf import ContentStream
from PyPDF2.utils import b_
@eirikb
eirikb / .sassrc.js
Created March 15, 2018 09:24
Demo of parcel + scss
const path = require('path');
const cwd = process.cwd();
module.exports = {
"includePaths": [
path.resolve(cwd, 'node_modules'),
path.resolve(cwd, 'src')
]
};
@geedew
geedew / symlink.sh
Last active November 21, 2022 10:00
A cross platform symlink method in Bash
@awto
awto / leak.js
Created March 5, 2018 17:02
leaking async generator
function subject(...args) {
let callback
const queue = []
const iter = thread()
let running = true
return {
send(event) {
if (callback)
callback()
queue.push(event)
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
export default function combine(mapConnectsToProps) {
const connectsKeys = Object.keys(mapConnectsToProps);
const combinedMapStateToProps = (state, ownProps) => {
const stateProps = {};
connectsKeys.forEach((connectKey) => {
@leohxj
leohxj / .cz-config.js
Last active May 19, 2023 03:49
cz-customizable with emoji
'use strict';
module.exports = {
types: [
{
value: 'WIP',
name : '💪 WIP: Work in progress'
},
{
@robrichard
robrichard / react-relay.js
Created November 1, 2017 16:40
Mock for relay modern
import React from 'react';
import PropTypes from 'prop-types';
const relayMock = jest.genMockFromModule('react-relay');
const relayChildContextTypes = {
relay: PropTypes.object
};
const relayEnvironment = {
lookup: jest.fn()
@noygal
noygal / Windows Subsystem for Linux version 1 and 2 (WSL) - node install guide.md
Last active October 16, 2024 01:06
Installing node via windows subsystem for linux

Windows 10 version 2004 - Installing Node.js on Windows Subsystem for Linux (WSL/WSL2)

UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.

Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar

@MoOx
MoOx / README.md
Last active May 11, 2023 13:59
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
@matthiask
matthiask / render_bundle_inline.py
Created September 11, 2017 08:52
render_bundle_inline for django-webpack-loader
import io
import os
from django import template
from django.conf import settings
from django.utils.html import mark_safe
from webpack_loader import utils