Skip to content

Instantly share code, notes, and snippets.


huangyanxiong huangyanxiong01

View GitHub Profile
huangyanxiong01 / dev.yml
Created Jun 5, 2021 — forked from maxkostinevich/dev.yml
Github Actions - Deploy Serverless Framework (AWS)
View dev.yml
# Github Actions for Serverless Framework
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
# Learn more:

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

huangyanxiong01 /
Last active Oct 26, 2019
BeautifulSoup remove html element attrs
from bs4 import BeautifulSoup
with open("mock/scrapy-post.html") as fp:
sp = BeautifulSoup(fp,features="lxml")
childs = sp.find('body').children
for element in childs:
element.attrs = {}
huangyanxiong01 / flatten-array.js
Created Sep 4, 2018 — forked from Integralist/flatten-array.js
Array flatten function written in ES6 syntax
View flatten-array.js
const flattenTco = ([first,], accumulator) =>
(first === undefined)
? accumulator
: (Array.isArray(first))
? flattenTco([...first,])
: flattenTco(rest, accumulator.concat(first))
const flatten = (n) => flattenTco(n, []);
huangyanxiong01 /
Created Aug 25, 2018 — forked from staltz/
The introduction to Reactive Programming you've been missing
huangyanxiong01 /
Created Dec 27, 2017 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

huangyanxiong01 / gist:5a3deed2092fafcc8bae44498ae07c72
Created Aug 15, 2017 — forked from hayderimran7/gist:9246dd195f785cf4783d
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
View gist:5a3deed2092fafcc8bae44498ae07c72
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
huangyanxiong01 / gist:98e8333604418daa04533ebf38be90bf
Last active Apr 1, 2017
View gist:98e8333604418daa04533ebf38be90bf


export  default (quantity,minChar = 5,maxChar = 10,fn) => {
  let randomArray = [];
  while (randomArray.length < quantity){
    let num = Math.ceil(Math.random()*minChar*(maxChar/minChar));
    if (num >= minChar) randomArray.push(fn(num));
  return randomArray;
View How to install tcpping on

To install tcptraceroute on Debian/Ubuntu:

$ wget
$ sudo dpkg -i tcping-1.3.5.deb

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

huangyanxiong01 / 0_reuse_code.js
Created Nov 24, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console