Skip to content

Instantly share code, notes, and snippets.

@plusor
plusor / install-chrome-headless.sh
Created October 29, 2020 07:56 — forked from ipepe/install-chrome-headless.sh
Installing headless chrome on Ubuntu.
#!/bin/bash
# from https://chromium.woolyss.com/
# and https://gist.github.com/addyosmani/5336747
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox http://example.org/
[
{ "keys": ["alt+super+["], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }
]
@plusor
plusor / AirPush.sol
Last active August 31, 2018 02:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=undefined&optimize=true&gist=
pragma solidity ^0.4.24;
contract AirPush {
}
@plusor
plusor / db.rake
Created January 12, 2018 09:18 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@plusor
plusor / gist:73473901ac882ef0422d685d19b9087e
Created July 7, 2017 06:03 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@plusor
plusor / Ruby 标准库.md
Last active December 24, 2015 01:29
Ruby 标准库
@plusor
plusor / lerning.md
Created September 26, 2013 14:50
关于学习

以前是不是有过突然有钻研的劲头,研究完之后又到了三点一线的生活, 其实你有没有发现只有当你有目标的时候你会废寝忘食的去钻研. 这段时间的进步也是不容忽视的. 为什么别人工作干了很多年技术却进步不大呢? 不是说没有热情,而是没有找到适合的学习方法.我就把自己的学习方法都记录在这,以后发现好的都会记录在这.

如何找准目标

也许这个'准'字都认为非常的不好找. 其实是你把目标定位的太远了,以至于在想的时候就对做产生畏惧的心理.

  • 认识自己

找到你目前所处的阶段, 不够? 这里

@plusor
plusor / Minitest Assertions.md
Created July 29, 2013 14:27
Minitest Assertions

Assertion Example

assert              assert                            @subject.any?     ,"empty subjects"
assert_block        assert_block                      { @subject.any? }
@plusor
plusor / ubuntu配置PPTP.md
Created July 29, 2013 14:26
ubuntu配置PPTP

Starting PPTP Daemon: /etc/pptpd.conf: No such file or directory

sudo apt-get purge pptpd
sudo apt-get install pptpd
  • vi /etc/rc.local