Skip to content

Instantly share code, notes, and snippets.

@kebien6020
kebien6020 / WordExportAsPdf.vba
Last active April 25, 2018 14:04
Word vba macro to instantly export as pdf in the same folder
Sub ExportAsPDF()
'Instantly export as pdf in the same folder
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
Replace(Replace(ActiveDocument.FullName, ".docx", ".pdf"), ".doc", ".pdf"), _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:= _
wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End Sub
queryInterface.createTable('actions', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
},
system_id: {
type: Sequelize.STRING,
},
rule_id: {
int EstimateLastAiredEpisodeNumber(const Item& item) {
// Can't estimate for other types of anime
if (item.GetType() != kTv)
return 0;
// TV series air weekly, so the number of weeks that has passed since the day
// the series started airing gives us the last aired episode. Note that
// irregularities such as broadcasts being postponed due to sports events make
// this method unreliable.
const Date& date_start = item.GetDateStart();
function* range(...args) {
let start, stop, step
if (args.length === 0) return
if (args.length === 1)
start = 0, stop = args[0], step=1
else
[start, stop, step = 1] = args
@kebien6020
kebien6020 / Unlock Sheet.vba
Last active April 25, 2018 13:55
Force Unlock Excel Sheet
Sub PasswordBreaker()
'Breaks worksheet password protection.
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
@kebien6020
kebien6020 / Module1.vba
Last active April 25, 2018 14:02
Unlock Excel VBA code
' Paste this into Module 1 of a new workbook
' Credit https://stackoverflow.com/a/27508116
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Long, Source As Long, ByVal Length As Long)
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _
@kebien6020
kebien6020 / ExcelExportAsPDF.vba
Last active April 25, 2018 14:05
Excel macro to Instantly export as pdf in the same folder
Sub ExportAsPDF()
'Instantly export as pdf in the same folder
Dim filename As String
filename = ActiveWorkbook.FullName
filename = Replace(filename, ".xlsm", ".pdf")
filename = Replace(filename, ".xlsx", ".pdf")
filename = Replace(filename, ".xls", ".pdf")
filename = Replace(filename, ".xlb", ".pdf")
ActiveWorkbook.ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
=SIFECHA(D17,E17,"y")&" años, "
&SIFECHA(D17,E17,"ym")&" meses, "
&E17-FECHA(AÑO(E17),MES(E17),1)&" dias"
# Don't cd $HOME
set-environment -g CHERE_INVOKING 1
# Change windows / resize panes using the mouse
set -g mouse on
# True color
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
@kebien6020
kebien6020 / SankakuButtonToOldSite.user.js
Last active April 30, 2019 04:22
Go to the old site at the current image clicking an orange circle at the bottom. This circle turns blue if the image has notes.
// ==UserScript==
// @name Button to old page
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show a button to go to the old site!
// @author Baku
// @updateURL https://gist.github.com/kebien6020/f6489944130a8d891dbebffbe4388b08/raw/SankakuButtonToOldSite.user.js
// @downloadURL https://gist.github.com/kebien6020/f6489944130a8d891dbebffbe4388b08/raw/SankakuButtonToOldSite.user.js
// @match https://beta.sankakucomplex.com/*
// @grant none