Skip to content

Instantly share code, notes, and snippets.

@zdienos
zdienos / set_layar.sh
Created August 18, 2018 08:34
Set Kecerahan Layar (Brightness) menggunakan script
#!/bin/sh
CURRBRIGHT=$(xrandr --current --verbose | grep -m 1 'Brightness:' | cut -f2- -d:)
if [ "$1" = "+" ] && [ $(echo "$CURRBRIGHT < 1" | bc) -eq 1 ]
then
xrandr --output $2 --brightness $(echo "$CURRBRIGHT + 0.1" | bc)
elif [ "$1" = "-" ] && [ $(echo "$CURRBRIGHT > 0" | bc) -eq 1 ]
then
xrandr --output $2 --brightness $(echo "$CURRBRIGHT - 0.1" | bc)
fi
@zdienos
zdienos / clone.bash
Created August 26, 2018 11:00 — forked from milanboers/clone.bash
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@zdienos
zdienos / AND_OR_NOT
Created September 1, 2018 10:38 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@zdienos
zdienos / resizeImage.js
Created September 3, 2018 11:57 — forked from oliverdoetsch/resizeImage.js
automatically resize blogger images to fit full blog post area
<script language='javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$.fn.resizeImage = function() {
$('.post-body').table_to_div();
var postWidth = $('.post-body').width();
var sAttribut = /\/s\B\d{2,4}/;
$('.post-body').find('img').each(function(n, image){
@zdienos
zdienos / Google Blogger Social Meta Tags.html
Created September 3, 2018 16:47 — forked from milanaryal/Google Blogger Social Meta Tags.html
Google Blogger/BlogSpot Social Meta Tags for Facebook, Twitter, Google+, Pinterest [v1.0]
<!-- add the following code in the head tag -->
<head prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<!-- Share Image -->
<link href='YOUR_LOGO_IMAGE' rel='image_src'/>
<!-- Open Graph Meta Tags -->
<b:if cond='data:blog.pageType != &quot;index&quot;'>
<meta expr:content='data:blog.title' property='og:site_name'/>
@zdienos
zdienos / Google Blogger Social Meta Tags.html
Created September 5, 2018 03:14 — forked from sverrirs/Google Blogger Social Meta Tags.html
Because it is notoriously difficult, here is how you integrate social media tags for Facebook, Twitter, Google+ and Pinterest into Google Blogger template. Tested and validated by myself on blogger.com in August 2015. This is based on https://gist.github.com/MilanAryal/92997b311580c6e96dd0 but with important fixes and different integration strat…
<!-- add the following code in the head and body tags -->
<head prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<body itemscope='itemscope' itemtype='http://schema.org/Blog' prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#'>
<!--
I've found easiest to simply include the rest of the tags in the body of the webpage.
The browser will automatically interpret the should-be header tags correctly.
The only problem, and unavoidable when using a blogger template is that the Pintrest markup
will not currently work with their Rich Pin validation tool.
@zdienos
zdienos / lampp
Last active September 14, 2018 00:29
Make XAMPP Automatic Start on Ubuntu Linux
#!/bin/bash
### BEGIN INIT INFO
# Provides: lampp
# Required-Start: $local_fs $syslog $remote_fs dbus
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start lampp
### END INIT INFO
/opt/lampp/xampp start
@zdienos
zdienos / opengraph.xml
Created September 15, 2018 08:28
OpenGraph for Social Media
<!-- [ Social Media Meta Tag ] -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<meta expr:content='data:blog.pageName' property='og:title'/>
<meta expr:content='data:blog.canonicalUrl' property='og:url'/>
<meta content='article' property='og:type'/>
</b:if>
<meta expr:content='data:blog.title' property='og:site_name'/>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<meta expr:content='data:blog.metaDescription' name='description'/>
<meta expr:content='data:blog.title' property='og:title'/>
@zdienos
zdienos / instagram_api.php
Created December 18, 2018 10:56 — forked from arturmamedov/instagram_api.php
Instagram API retrive access token with PHP curl
<?php
// yo can follow this guide to http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token#
#1 first you need to create a Client in Instgram Developer Dashboard
// https://www.instagram.com/developer/clients/manage/
#2 after you need to retrive a oAuth code for after get access_token
// https://www.instagram.com/developer/authentication/
// change the params with your one and open link in browser
@zdienos
zdienos / Home.php
Created March 10, 2019 10:20 — forked from whaone79/Home.php
Mengakses SQL Server 2008R2 dari PHP menggunakan CodeIgniter, silahkan lihat di http://w4w417.wordpress.com/2016/01/09/mengakses-sql-server-2008r2-dari-php-menggunakan-codeigniter/
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Home extends CI_Controller {
public function index()
{
$this->db = $this->load->database('default', TRUE);
$sql = "select ITM_CD,ITM_NAME,PRICE from dbo.RETAIL_ITEM ";