Skip to content

Instantly share code, notes, and snippets.

View paradite's full-sized avatar
👀
Looking for interesting projects

Zhu Liang paradite

👀
Looking for interesting projects
View GitHub Profile
@paradite
paradite / test.ts
Created March 31, 2025 09:51
doesn't work bro
type State = 'initialized' | 'processing' | 'completed' | 'failed';
interface Pipeline<T extends State> {
state: T;
start(this: Pipeline<'initialized'>): Pipeline<'processing'>;
finish(this: Pipeline<'processing'>): Pipeline<'completed'>;
retry(this: Pipeline<'failed'>): Pipeline<'processing'>;
}
declare const p: Pipeline<'initialized'>;
@paradite
paradite / deepseek-r1-todo-fireworks.md
Last active February 3, 2025 12:44
Conversation of DeepSeek R1 solving a coding task in 16x Prompt

User: You are tasked to implement a feature. Instructions are as follows:

add created_at field to todos, update both backend and frontend.

Instructions for the output format:

  • Output code without descriptions, unless it is important.
  • Minimize prose, comments and empty lines.
  • Only show the relevant code that needs to be modified. Use comments to represent the parts that are not modified.
  • Make it easy to copy and paste.
@paradite
paradite / LICENSE
Last active November 2, 2024 19:12
d3.js range selection using drag
MIT License
Copyright (c) 2020 Zhu Liang
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:
@paradite
paradite / projects.md
Created July 4, 2023 17:14
Recent projects
@paradite
paradite / paste.js
Last active January 24, 2023 10:48
intercept paste and do formatting in JavaScript (in Angular.js)
// tested in Chrome and Firefox
this.onPaste = function (event) {
if($(event.target).is(':focus')) {
// actually typing on the element, stop paste progation to outside paste handler
event.stopPropagation();
// intercept paste and format the text
event.preventDefault();
var newText = (event.originalEvent || event).clipboardData.getData('text/plain');
newText = newText.replace(/\r?\n/g, ' ');
'use strict';
const fs = require('fs');
const url = require('url');
const path = require('path');
const iOSUtils = require('ios-utils');
const EventEmitter = require('events');
const childProcess = require('child_process');
const _ = require('./helper');
@paradite
paradite / ul
Created February 7, 2020 04:33
ul test
https://play.google.com/store/apps/details?id=com.twitter.android
@paradite
paradite / tester.js
Created November 4, 2018 02:38 — forked from freedmand/tester.js
JavaScript unit testing in under 30 lines
const PASS = ['32']; // green
const FAIL = ['31', '1']; // red, bold
function logStyle(ansiEscapeCodes, text) {
console.log(`\x1b[${ansiEscapeCodes.join(';')}m${text}\x1b[0m`);
}
class Tester {
constructor() {}
@paradite
paradite / .travis.yml
Created December 16, 2017 10:01 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:

Credits here: FortAwesome/Font-Awesome#4167

I agree. Use Pure css, with border-radius and a fixed width and height.

For example:

.social [class*="fa fa-"] {
    background-color: #333;
 border-radius: 30px;