This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === In Cargo.toml file====== | |
// lettre = "0.9.2" | |
// lettre_email = "0.9.2" | |
// native-tls = "0.2.3" | |
// ============================ | |
use lettre_email::Email; | |
use lettre::smtp::authentication::Credentials; | |
use lettre::{ClientSecurity, ClientTlsParameters, SmtpClient, Transport}; | |
use native_tls::TlsConnector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Try to run http.server. Default port is 8000. | |
If 8000 is in use, use 8001... | |
""" | |
import socket | |
import errno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code from best solution in page below: | |
# https://help.zoho.com/portal/community/topic/zoho-mail-servers-reject-python-smtp-module-communications | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email.utils import formataddr | |
# Define to/from | |
sender = 'sender@example.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code works | |
// BRSimplePrintViewController.swift | |
// SDK_Sample_Swift | |
// | |
// Copyright © 2017 Brother Industries, Ltd. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -*- coding: utf-8 -*- | |
# @date: 2012-09-20 | |
# @author: Frank.Xu | |
# @version: 0.1 | |
# @description: Remove useless packages in Pi | |
sudo apt-get remove --purge wolfram-engine libreoffice* | |
sudo apt-get clean | |
sudo apt-get autoremove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Fast paren mode 1.0 | |
;; Copyright(C) 2012, CrLF0710 | |
;; Please use this code under BSD license | |
(defun fast-paren-space () | |
(interactive) | |
(if (member (preceding-char) '(0 9 10 32 40)) | |
(if (and (symbol-value 'paredit-mode) | |
(symbol-function 'paredit-open-round)) | |
(funcall 'paredit-open-round) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RemoveAdsOnSalangane-books | |
// @namespace salangane_books | |
// @author Frank_Xu | |
// @include http://salangane-books.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// 本脚本去掉海燕烦人的广告 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('a[href*=#]').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
&& location.hostname == this.hostname) { | |
var $target = $(this.hash); | |
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']'); | |
if ($target.length) { | |
var targetOffset = $target.offset().top; | |
$('html,body').animate({scrollTop: targetOffset}, 1000); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Webpage: http://emacswiki.org/emacs/ParEdit | |
(require 'paredit) | |
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode 1))) | |
(add-hook 'lisp-mode-hook (lambda () (paredit-mode 1))) | |
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode 1))) | |
(add-hook 'python-mode-hook (lambda () (paredit-mode 1))) | |
(add-hook 'scheme-mode-hook (lambda () (paredit-mode 1))) | |
(add-hook 'clojure-mode-hook (lambda () (paredit-mode 1))) | |
;;https://github.com/grettke/parenface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init)))) | |
(ql:quickload '(:split-sequence :alexandria)) | |
(use-package :alexandria) | |
;; Color Spade 黑桃 Heart 红心 Diamond 红钻 Club 黑莓 |
NewerOlder