Skip to content

Instantly share code, notes, and snippets.

@xmeng1
xmeng1 / docker-clear.bat
Created Jun 3, 2018 — forked from daredude/docker-clear.bat
delete all docker container and images on windows
View docker-clear.bat
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i
@xmeng1
xmeng1 / slack_delete.rb
Created Jan 25, 2018 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
View slack_delete.rb
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@xmeng1
xmeng1 / increment-pom-versions.sh
Created Nov 21, 2017 — forked from pdunnavant/increment-pom-versions.sh
Script that uses the versions-maven-plugin to automatically increment the build number in the version of a project. This is intended to be used in a continuous delivery environment.
View increment-pom-versions.sh
#!/bin/bash
#################################################################################
# WARNING: DO NOT JUST RUN THIS SCRIPT BLINDLY. MAKE SURE YOU UNDERSTAND WHAT IT
# IS DOING. IT *WILL* TRY TO COMMIT CHANGES. IT WILL ALSO TRY TO EAT YOUR
# CHILDREN. IT MAY CAUSE THE SUN TO GO SUPERNOVA. I CLAIM NO RESPONSIBILITY FOR
# WHATEVER HAPPENS AFTER YOU RUN THIS. NOW, CARRY ON. :-)
#
# This script, run from the root of a Maven single or multi-module project, will
# update the pom files to increment the build number on the version.
@xmeng1
xmeng1 / sync-git-upstream.sh
Created Oct 31, 2017
Git Sync with Upstream
View sync-git-upstream.sh
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git pull upstream master
@xmeng1
xmeng1 / [FEDORA] gitkraken
Created Oct 11, 2017 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora 25 + launcher icon
View [FEDORA] gitkraken
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/gitkraken
cd /opt
@xmeng1
xmeng1 / instructions.md
Created Aug 3, 2017 — forked from tpai/instructions.md
use both Tor and Privoxy with Mac OSX
View instructions.md

1. install

brew install tor
brew install privoxy

2. copy and modify config file

@xmeng1
xmeng1 / webcrawler.js
Created Jul 26, 2017 — forked from antivanov/webcrawler.js
Simple PhantomJS-based web crawler library
View webcrawler.js
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
@xmeng1
xmeng1 / sublime-install.sh
Created Jun 8, 2017 — forked from welshstew/sublime-install.sh
sublime text 3 install
View sublime-install.sh
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/usr/local/sublime-text-3/sublime_text
Icon=/usr/local/sublime-text-3/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
@xmeng1
xmeng1 / dynamicl_control_DOM_by_event.ts
Created Feb 23, 2017
dynamicl_control_DOM_by_event According to debug find that we can get the element by click event and so on.
View dynamicl_control_DOM_by_event.ts
setCssDynamical($event) {
console.log($event);
$event.source.trigger.nativeElement.childNodes[0].setAttribute("style", "font-size: 20px;font-weight: bold")
//mat-select-trigger
//mat-select-placeholder
//let elt = document.getElementsByClassName("mat-select-placeholder").item(0);
//elt.setAttribute("style", "font-size: 20px;font-weight: bold");
}
@xmeng1
xmeng1 / input.html
Created Feb 20, 2017
angular material 2
View input.html
<md-input-container dividerColor="accent" class="input-container" floatPlaceholder="Test">
<span md-prefix>$&nbsp;</span>
<span md-suffix>.00</span>
<input mdInput name="value" ngModel placeholder="amount" align="end" >
</md-input-container>