Skip to content

Instantly share code, notes, and snippets.

View timqian's full-sized avatar
🏖️
In a gap year. Open to new opportunities

Tim Qian timqian

🏖️
In a gap year. Open to new opportunities
View GitHub Profile
@timqian
timqian / blast_any_spin.js
Created November 24, 2023 03:06 — forked from ksaynice/blast_any_spin.js
Blast Airdrop Lucky/Twitter/Super Spin AUTO Scripts
const axios = {
get(url, { headers = {} }) {
return new Promise((resolve, reject) => {
const xhr = window.XMLHttpRequest
? new XMLHttpRequest()
: new ActiveXObject("Microsoft.XMLHTTP");
xhr.open("get", url);
xhr.withCredentials = true;
// Object.entries(headers).forEach(([key,value]) => xhr.setRequestHeader(key, value));
/**
* Delete x files; Add x files => rename x files
* Modify x files
*/
const fs = require('fs').promises;
const path = require('path');
const modify = async (x, folderPath) => {
let renameCount = 0;
@timqian
timqian / findErr.js
Created October 28, 2020 07:25
Find errors thrown by serverless
#!/usr/bin/env node
/**
* 1. Get all files
* 2. Find `new ServerlessError`
* 3. Copy error message and status code
*/
const fs = require('fs');
const path = require('path');
@timqian
timqian / AWS Swarm cluster.md
Last active October 31, 2017 09:10 — forked from ghoranyi/AWS Swarm cluster.md
Create a Docker 1.12 Swarm cluster on AWS

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

@timqian
timqian / hn_seach.js
Created October 6, 2015 17:06 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments);
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {