Skip to content

Instantly share code, notes, and snippets.

@xmeng1
xmeng1 / sublime-install.sh
Created June 8, 2017 13:16 — forked from welshstew/sublime-install.sh
sublime text 3 install
#!/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 / webcrawler.js
Created July 26, 2017 07:53 — forked from amoilanen/webcrawler.js
Simple PhantomJS-based web crawler library
//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 / instructions.md
Created August 3, 2017 07:50 — forked from tpai/instructions.md
use both Tor and Privoxy with Mac OSX

1. install

brew install tor
brew install privoxy

2. copy and modify config file

@xmeng1
xmeng1 / [FEDORA] gitkraken
Created October 11, 2017 07:59 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora 25 + launcher icon
#!/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 / slack_delete.rb
Created January 25, 2018 11:14 — 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.
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 / gitkraken-install.sh
Last active June 21, 2018 11:48 — forked from seangtkelley/gitkraken-install.sh
Install Script for Gitkraken on Fedora 27 + Launcher Icon
#!/bin/bash
# Enter /opt folder (common folder for user installed programs)
# This script assumes you have proper permissions on /opt
cd /home/mengxin/Applications
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# Extract the Kraken into /opt directory
@xmeng1
xmeng1 / gnome-tracker-disable.md
Created October 16, 2018 14:21 — forked from nuxwin/gnome-tracker-disable.md
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@xmeng1
xmeng1 / kraken.fish
Created July 29, 2019 10:04 — forked from BBlackwo/kraken.fish
Open GitKraken from the terminal
## Forked from https://gist.github.com/dersam/0ec781e8fe552521945671870344147b
## Also received help from https://twitter.com/gitkraken/status/691675309725368321
## Open GitKraken using the current repo directory.
## This code is for fish shell. The same thing can be done in bash
## by creating an alias with the command below.
## `1>/dev/null` directs logs from the terminal
## `&` allows use of the same terminal instance to do other things
@xmeng1
xmeng1 / IntelliJ_IDEA__Perf_Tuning.txt
Created July 30, 2019 10:24 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@xmeng1
xmeng1 / workers.sql
Created August 14, 2019 10:43 — forked from kenjipm/workers.sql
The following data definition defines an organization's employee hierarchy. An employee is a manager if any other employee has their managerId set to the first employees id. An employee who is a manager may or may not also have a manager. TABLE employees id INTEGER NOT NULL PRIMARY KEY managerId INTEGER REFERENCES employees(id) name VARCHAR(30) …
SELECT name FROM employees
WHERE id NOT IN (SELECT managerId FROM employees WHERE managerId IS NOT NULL);