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
<?php | |
require_once 'vendor/autoload.php'; | |
use Google\Cloud\Storage\StorageClient; | |
class MySessionHandler implements SessionHandlerInterface{ | |
private $savePath; | |
private $storage; | |
private $bucket; | |
public function __construct(){ |
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
$objPHPExcel->disconnectWorksheets(); | |
unset($objPHPExcel); |
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
package com.radityopw.simpledb; | |
public class CommandResult{ | |
public static final int OK = 1; | |
public static final int ERROR = 2; | |
public static final int EXIT = 3; | |
public int status = CommandResult.OK; | |
public String message = ""; |
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
# Swap | |
[._]*.s[a-v][a-z] | |
!*.svg # comment out if you don't need vector files | |
[._]*.sw[a-p] | |
[._]s[a-rt-v][a-z] | |
[._]ss[a-gi-z] | |
[._]sw[a-p] | |
# Session | |
Session.vim |
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
CREATE TRIGGER <schema>.<table_name>_read_only_events ON <schema>.<table_name> | |
INSTEAD OF INSERT, | |
UPDATE, | |
DELETE | |
AS | |
BEGIN | |
RAISERROR( 'table is read only.', 16, 1 ) | |
ROLLBACK TRANSACTION | |
END |
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
;WITH CTE_Dev | |
AS ( | |
SELECT C.column_id | |
,ColumnName = C.NAME | |
,C.max_length | |
,C.user_type_id | |
,C.precision | |
,C.scale | |
,DataTypeName = T.NAME | |
FROM sys.columns C |
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
# install library | |
pip install pywin32 | |
# import komponen | |
import win32com.client | |
# untuk membuka excel | |
xl = win32com.client.Dispatch('Excel.Application') |
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
CREATE FUNCTION [dbo].[LEVENSHTEIN]( @s NVARCHAR(MAX), @t NVARCHAR(MAX) ) | |
/* | |
Levenshtein Distance Algorithm: TSQL Implementation | |
by Joseph Gama | |
http://www.merriampark.com/ldtsql.htm | |
Returns the Levenshtein Distance between strings s1 and s2. | |
Original developer: Michael Gilleland http://www.merriampark.com/ld.htm | |
Translated to TSQL by Joseph Gama |
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
import pyodbc | |
import time | |
from shutil import copy | |
import smtplib | |
import os | |
import datetime | |
def backup_db(cnxn,mode,backup_dir,secondary_backup_dirs,dbname): | |
backup_name = dbname+"-"+mode+" database backup" |
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
/* | |
drop table #source ; | |
drop table #source_diff; | |
drop table #source_deleted; | |
*/ | |
declare @last_synchronization_version bigint; |