Skip to content

Instantly share code, notes, and snippets.

View syn-arch's full-sized avatar
🎯
Focusing

Adiatna Sukmana syn-arch

🎯
Focusing
  • Bandung,Indonesia
View GitHub Profile
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@syn-arch
syn-arch / folderlock.bat
Created January 12, 2023 10:22 — forked from fobabs/folderlock.bat
A batch file used to lock and hide folders and files in Windows 10
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
@syn-arch
syn-arch / change mass.sql
Created January 5, 2022 06:58
mysql update column with value from another table
UPDATE tableB
INNER JOIN tableA ON tableB.name = tableA.name
SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
WHERE tableA.name = 'Joe'
@syn-arch
syn-arch / mysql.sql
Created December 1, 2021 09:12
Drop all table on mysql
SELECT concat('DROP TABLE IF EXISTS `', table_name, '`;')
FROM information_schema.tables
WHERE table_schema = 'MyDatabaseName';
@syn-arch
syn-arch / permission.js
Created December 1, 2021 09:06
Request permission to camera & microphone
navigator.permissions.query({name: 'microphone'})
.then((permissionObj) => {
console.log(permissionObj.state);
})
.catch((error) => {
console.log('Got error :', error);
})
navigator.permissions.query({name: 'camera'})
.then((permissionObj) => {
@syn-arch
syn-arch / mysqld.conf
Last active November 27, 2021 13:44
SELECT list is not in GROUP BY clause and contains nonaggregated column .... incompatible with sql_mode=only_full_group_by
Step 1:
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Step 2: Go to last line and add the following
sql_mode = ""
Step 3: Save
Step 4: Restart mysql server.
@syn-arch
syn-arch / mod_rewrite_guide.md
Last active January 11, 2022 07:07 — forked from dario2994/mod_rewrite_guide.md
Enable mod_rewrite in apache
  • Apache configuration file

    • ubuntu -> /etc/apache2/apache2.conf
    • arch -> /etc/httpd/conf/httpd.conf
  • Add mod_rewrite and .htaccess support for your site At the end of the configuration files add these lines:

    #My site mod_rewrite configuration
    <Directory "/var/www/">
      AllowOverride All
    
@syn-arch
syn-arch / Auto indext for sublime text 3.json
Last active January 7, 2022 10:53
add this binding to your "Key Bindings - User" file: Preferences > Key Bindings - users
{"keys": ["ctrl+shift+x"], "command": "reindent", "args": {"single_line": false}}