Skip to content

Instantly share code, notes, and snippets.

View anovsiradj's full-sized avatar

MDMCDC anovsiradj

View GitHub Profile
<?php
$s = __FILE__;
$l = __DIR__.'/tmp.log';
$p = __DIR__.'/tmp.pid';
$z=$c=$r=null;
if (in_array('bg',$argv)) {
file_put_contents($p,getmypid());
die;
}
@anovsiradj
anovsiradj / ncr.js
Last active March 19, 2020 15:06
[DEPRECATED] blogger / blogspot - NoCountryRedirect (NCR) always use ".com" instead ".co.id"
if(/.co.id/.test(window.location.hostname)) window.location.replace(window.location.href.replace('.co.id','.com/ncr'));
// ==UserScript==
// @name Adminer Tweak
// @description simple dashboard tweak for adminer.php (database management)
// @version 2019.10.16
// @namespace https://gist.github.com/anovsiradj/fb4254d6fb6eb6f8bc08d3686482aaec
// @run-at document-end
// @match http://localhost/adminer.php*
// @match http://localhost/adminer*.php*
// @author anovsiradj (mayendra costanov)
// @iconURL https://www.adminer.org/favicon.ico
@anovsiradj
anovsiradj / looper.less
Last active October 7, 2019 02:24
LESS: Loop dynamic selector rule (CSS)
.looper(@class, @property, @unit: px, @min: 0, @max: 10, @step: 1) {
.loop(@i) when (@i <= @max) {
@cls: e(replace(@class, '\*', @i, 'g'));
@{cls} {
@{property}: unit(@i, @unit);
}
.loop(@i + @step);
}
.loop(@min);
}
@anovsiradj
anovsiradj / toggle-touchpad.sh
Last active September 6, 2019 14:29 — forked from v-dimitrov/touchpad-fix
touchpad fn key fix
#!/bin/sh
# toggle touch pad
device=`xinput list --name-only | grep -i touchpad`
isOn=`xinput list-props "$device" | grep -i enabled | tail -c 2`
iconEnabled='input-touchpad-symbolic'
iconDisabled='touchpad-disabled-symbolic'
case "$isOn" in
0)
@anovsiradj
anovsiradj / file1.pascal
Last active August 14, 2019 07:13
replace non-number and/or non-alphabet from string use free pascal
// fpc~3 //
program HelloWorld;
uses RegExpr;
var rgx_1,rgx_2,str_1 :string;
var rst :string;
begin
rgx_1 := '[^0-9]+';
@anovsiradj
anovsiradj / loop.xml
Last active August 19, 2018 07:32
Blogger/Blogspot dynamic CSS classes
<!-- https://ne-a-r.blogspot.com/ -->
<!-- padding/margin kelipatan 2 dan 5 (0 sampai 100)-->
<style>
<b:loop index='i' values='0 to 100' var='n'>
<b:if cond='data:n%5 == 0 OR data:n%2 == 0'>
.pd-<data:n/>{padding:<data:n/>px !important;}
.pd-t-<data:n/>{padding-top:<data:n/>px !important;}
.pd-b-<data:n/> {padding-bottom:<data:n/>px !important;}
.pd-l-<data:n/>{padding-left:<data:n/>px !important;}
.pd-r-<data:n/>{padding-right:<data:n/>px !important;}
@anovsiradj
anovsiradj / system-fonts.less
Last active August 12, 2018 07:48
css system fonts
/*
using OS fonts.
order, each vendor, new to old.
apple,
linux,
android,
windows
default.
*/
@anovsiradj
anovsiradj / so_content_first.user.js
Last active June 29, 2018 15:10
StackOverflow: Content First
// ==UserScript==
// @name StackOverflow: Content First
// @description remove unused html elements on stackoverflow.
// @namespace https://gist.github.com/anovsiradj
// @version 2018.06.29
// @author Mayendra Costanov (anovsiradj)
// @include *://stackoverflow.com/questions/*
// @run-at document-end
// @grant none
// ==/UserScript==
@anovsiradj
anovsiradj / blog-main.xhtml
Last active January 14, 2018 12:43
yetkdance
<!--
Posts List (Index/Archive/Search/Label/Tag/Category)
Belum tahu apa fungsinya, jadi di matikan dulu
penempatan, dibagian paling bawah:
<b:include cond='data:top.showPlusOne' name='googlePlusBootstrap'/>
belum ada iklan, jadi dihapus dulu, lokasi dalam <loop> paling bawah:
<b:if cond='data:post.includeAd'><div class='inline-ad'><data:adCode/></div></b:if>
-->