Skip to content

Instantly share code, notes, and snippets.

View benyaminl's full-sized avatar
😬
Crazy with C#

Benyamin Limanto benyaminl

😬
Crazy with C#
View GitHub Profile
@benyaminl
benyaminl / login.ascx
Created April 14, 2018 04:09
login.ascx
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="login.ascx.vb" Inherits="Praktikum1.login" %>
<%--Harus ditaruh sebelum control validate, kaya js biasa--%>
<script type="text/javascript">
function validateEmptyUsername(oSrc, args) {
args.IsValid = (args.Value.length > 0);
if (!args.IsValid) {
$("#<%=TextBox1.ClientID%>").addClass("is-invalid");
}
else {
// JQ ga bakalan perlu check, kalau ada disana dia
@benyaminl
benyaminl / load-infile.sql
Last active January 26, 2020 05:33
MySQL Load Infile
--- Load All data Infile
SHOW VARIABLES LIKE "local_infile";
SET GLOBAL LOCAL_INFILE = 1;
SHOW VARIABLES LIKE "secure_file_priv";
load data infile
'/var/opt/rh/rh-mysql57/lib/mysql-files/saldo22.csv'
INTO TABLE hokky.`__import_all`
FIELDS TERMINATED BY ','
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<form method="post" action="">
@benyaminl
benyaminl / OpenWithVim-Add.reg
Last active August 18, 2022 01:26
This's a Regedit Key for Windows that's used for adding and remove Open With Vim on Windows Folder and Background Folder, and Windows Library. This make Vim works like Opening Project in Open VS Code Functionality
REGEDIT4
[HKEY_CLASSES_ROOT\Folder\shell\VimHere]
@="Open with &Vim"
"Icon"="C:\\Apps\\vim\\gvim.exe,0"
[HKEY_CLASSES_ROOT\Folder\shell\VimHere\command]
@="\"C:\\Apps\\vim\\gvim.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\VimHere]
@="Open with &Vim"
@benyaminl
benyaminl / userChrome.css
Last active May 2, 2021 01:44
userChrome.css that remove or fix proton view on windows 10, with disabling megabar. It's originate from my works and some others from reddit /r/firefox. I hope this ease your pain on your computer views especially on old small laptop
/*** Megabar Styler General - version 2020-07-27 ***/
/*** General Preferences ***/
:root {
/* Number of pixels of enlargement when URL bar is focused */
--mbarstyler-popout-pixels: 0px; /* [0px - 7px] */
/* Top Bar Display or Not */
--mbarstyler-top-bar-display: block; /* [block,none] */
@benyaminl
benyaminl / remap.ahk
Last active October 30, 2021 15:11
Remaping the X220 Key for some usage like Browser back and Forward into PgUp and Down to various app, like Acrobat, Mendeley, Vim, Word, 7zip, Etc
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 2 ; contain
; remap global Win+E jadi Win+1
#e::#1
;#z::#!s
; Calendar
@benyaminl
benyaminl / main.py
Created March 11, 2022 05:19
Python ODBC connect to SQL Server 2008 from Windows 10 21H2
import pyodbc
# Specifying the ODBC driver, server name, database, etc. directly
con = pyodbc.connect('DRIVER={SQL Server Native Client 10.0};SERVER=127.0.0.1;PORT=1433;DATABASE=coba;UID=sa;PWD=12345')
# Using a DSN, but providing a password as well
# cnxn = pyodbc.connect('DSN=test;PWD=password')
# Create a cursor from the connection
db = con.cursor()
@benyaminl
benyaminl / QuickLinks.ahk
Last active October 18, 2023 18:41
QuickLinks Improvement from Jason Version, added .lnk and .url on root of QuickLinks, so we can make it faster to open folder, only one shortcut and one key press, boom opened folder
@benyaminl
benyaminl / spotify.sh
Created October 14, 2022 06:21
Show or Hide Spotify Flatpak, can be mapped to Thinkpad X220 ThinkVantage Button on XFCE
#!/bin/bash
STATUS=$(ps -aux | grep share/spotify/spotify | grep -v grep | wc -l)
if [ $STATUS -gt 0 ]
then
activeWindow=$(xprop -id $(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5) WM_NAME | cut -d '"' -f 2)
if [[ $activeWindow =~ "Spotify" ]]
then
wmctrl -r "spotify" -b toggle,hidden
@benyaminl
benyaminl / gvim-toggle.sh
Created October 15, 2022 03:06
GVIM toggle view or hide based on workspace, will start gvim if on that workspace there are no gvim. Useful to mimic AHK on Linux using WMCTRL. Tested on Fedora 36
#!/bin/bash
DESKTOP=$(wmctrl -d | grep "*" | awk --field-separator=" " '{print $1}')
STATUS=$(wmctrl -l | grep " $DESKTOP " | grep -i gvim | wc -l)
WIN=$(wmctrl -l | grep " $DESKTOP " | grep -i gvim | awk '{print $4}')
# zenity --notification --text="$STATUS $DESKTOP $WIN"
if [ $STATUS -gt 0 ]
then
activeWindow=$(xprop -id $(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5) WM_NAME | cut -d '"' -f 2)