Skip to content

Instantly share code, notes, and snippets.

View wlchn's full-sized avatar
🚀

Lei Wang wlchn

🚀
View GitHub Profile
@levino
levino / scrypt+6.0.3.patch
Created September 7, 2018 14:32
Patch scrypt to load with webpack
diff --git a/node_modules/scrypt/index.js b/node_modules/scrypt/index.js
index 7b13a79..1e40d76 100644
--- a/node_modules/scrypt/index.js
+++ b/node_modules/scrypt/index.js
@@ -1,6 +1,6 @@
"use strict";
-var scryptNative = require("./build/Release/scrypt")
+var scryptNative = require("./build/Release/scrypt.node")
, Crypto = require("crypto")
@deyixtan
deyixtan / sublime_text_patch.md
Last active July 25, 2025 07:17
Sublime Text Patching Guide

Automated Patching

Download slt.py python script (supports multiple build) from this repository.

Usage

python slt.py <"sublime_text file path">


Manual Patching

@rproenca
rproenca / Clipboard.js
Last active July 5, 2025 22:31
Copy text to clipboard using Javascript. It works on Safari (iOS) and other browsers.
window.Clipboard = (function(window, document, navigator) {
var textArea,
copy;
function isOS() {
return navigator.userAgent.match(/ipad|iphone/i);
}
function createTextArea(text) {
textArea = document.createElement('textArea');
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active June 6, 2025 20:27
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@techgaun
techgaun / readme.md
Created February 5, 2017 04:44
OpenSSH 7.4 on Ubuntu 16.04

Installing OpenSSH 7.4 on Ubuntu 16.04

sudo apt install -y build-essential libssl-dev zlib1g-dev
wget "http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz"
tar xfz openssh-7.4p1.tar.gz
cd openssh-7.4p1
./configure
make
sudo make install
@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@renshuki
renshuki / ubuntu_agnoster_install.md
Last active December 30, 2024 16:16
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

function partition(arr, left, right, pivot) {
var temp = arr[pivot];
arr[pivot] = arr[right];
arr[right] = temp;
var track = left;
for (var i = left; i < right; i++) {
if (arr[i]<arr[right]) {
var t = arr[i];
arr[i] = arr[track];
arr[track] = t;
@vertexclique
vertexclique / cracking.md
Last active July 25, 2025 07:22
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@lulalala
lulalala / banner.rb
Last active January 14, 2019 12:58 — forked from matheusvetor/banner.rb
Carrierwave image model validation on image dimensions/height/width.
class Banner < ActiveRecord::Base
attr_accessor :image_width, :image_height
mount_uploader :image, ImageUploader
validate :check_dimensions, :on => :create
def check_dimensions
if !image_cache.nil? && (image.width < 300 || image.height < 300)
errors.add :image, "Dimension too small."
end
end