start new:
tmux
start new with session name:
tmux new -s myname
Verifying my Blockstack ID is secured with the address 1A27dCp2zWG6SAoQpQRWbXUHSZeVa1C7XZ https://explorer.blockstack.org/address/1A27dCp2zWG6SAoQpQRWbXUHSZeVa1C7XZ |
#!/bin/bash | |
LOADING=false | |
DEBUG=/dev/null | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [options] <DBNAME> | |
# This file should be placed on the directory of ~/blog/config | |
upstream unicorn { | |
server unix:/tmp/unicorn.todo.socket fail_timeout=0; | |
} | |
server { | |
listen 80 default; | |
#server_name example.com; | |
root /home/username/blog/public; |
# encoding: UTF-8 | |
# happycasts database | |
namespace :db do | |
desc "get episods' info from the table episods" | |
task :episodes => :environment do | |
posts = [] | |
Episode.all.each do |e| | |
post = {} | |
post['id'] = e.id |
#No such file to load -- devise/confirmations_controller | |
#resque worker devise not eager loading | |
require File.expand_path('../config/application', __FILE__) | |
require 'rake/dsl_definition' | |
require 'resque/tasks' | |
Askjane::Application.load_tasks | |
task "resque:setup" => :environment do |
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
# encoding: UTF-8 | |
namespace :db do | |
desc "import some data to the users table" | |
task :users => :environment do | |
a = [] | |
File.open("lib/tasks/talk_production.sql", 'r') do |f| | |
a = f.read.strip.split(/\n/) | |
end | |
a.delete_at(0) | |
a.each do |e| |
// 1. How to check if one array has all elements of another? | |
var importedEmails = ['john@doe.com', 'janet@doe.com'], | |
existingEmails = ['john@doe.com', 'janet@doe.com', 'fred@mercury.com']; | |
if(!_.difference(importedEmails, existingEmails).length) console.log('already imported') | |
// > already imported | |
// ********************************************************** | |
// 2. How to find what elements are common to two arrays? |
# encoding: utf-8 | |
str = '' | |
File.open("tasks.md", 'r') do |f| | |
str = f.read | |
end | |
str = str.gsub(/^###\s?(.*?)\s?$/, "<h3>\\1</h3>\n"). | |
gsub(/^任务:\s?(.*?)\n$/, "<div>\n<h3>\\1</h3>\n<ul>"). | |
gsub(/^\-\s+视频:\s?(.*?)$/, "</ul>\n<a href='\\1'>视频</a>\n</div>\n"). |