Skip to content

Instantly share code, notes, and snippets.

@pebriana
pebriana / submit.md
Created January 10, 2019 06:47 — forked from tanaikech/submit.md
Downloading Shared Files on Google Drive Using Curl

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&amp;id=${fileid}"
@pebriana
pebriana / split merge pdf
Last active November 13, 2018 10:48
Splitting up is easy for a PDF file
source: https://linuxcommando.blogspot.com/2013/02/splitting-up-is-easy-for-pdf-file.html
Splitting up is easy for a PDF file
Occasionally, I needed to extract some pages from a multi-page pdf document. Suppose you have a 6-page pdf document named myoldfile.pdf. You want to extract into a new pdf file mynewfile.pdf containing only pages 1 and 2, 4 and 5 from myoldfile.pdf.
I did exactly that using pdktk, a command-line tool.
If pdftk is not already installed, install it like this on a Debian or Ubuntu-based computer.
@pebriana
pebriana / yiipaste.php
Last active September 4, 2018 03:47
Apri Yii CopyPaste
//add order by scope (model)
//call MODEL::model()->byiddesc()->find();
<?php
public function scopes() {
return array(
'byiddesc' => array('order' => 'id DESC'),
);
}
?>
@pebriana
pebriana / .css
Created July 26, 2017 07:19 — forked from abemedia/.css
Pure CSS horizontal accordion slider
.donslide {
display: table;
width: 100%;
}
.donslide .item {
display: table-cell;
width: 1%;
transition: 0.6s ease-in-out all;
overflow: hidden;
position: relative;
@pebriana
pebriana / html
Created October 18, 2016 05:50
checkbox checked if the values in array
<table>
<tr>
<td width="3%"></td>
<td>
<input class="weekdays" type="checkbox" name="weeklyDay" id="sunday" value="sunday">Sunday</td>
<td>
<input class="weekdays" type="checkbox" name="Day" id="monday" value="monday">Monday</td>
<td>
<input class="weekdays" type="checkbox" name="Day" id="tuesday" value="tuesday">Tuesday</td>
<td>
@pebriana
pebriana / gist:06465f7c8a0deadc5ed9cc8e3547b14d
Created October 18, 2016 04:56
jquery id selector wildcard
$(document).ready(function() {
$("[id^=hideshow]").click(function() {
var index = parseInt($(this).attr("id").replace('hideshow',''), 10);
});
});
@pebriana
pebriana / controller.php
Created June 2, 2016 03:38
how to change values in a dropdown list using ajax in Yii
public function actionMysubcategory(){
$model = new YourModel();
$cid = Yii::app()->request->getPost('cid');
$subcategory= Subcategory::model()->findAll(
array('order'=>'sid',
'condition'=>'cid=:cid',
'params'=>array(':cid'=>$cid)));
$list = CHtml::listData($subcategory,
'sid', 'sname');
echo CHtml::activeDropDownList($model,'sid',$list);
@pebriana
pebriana / create_rotating_backups.sh
Created May 4, 2016 08:13
Create rotating backups
#!/bin/bash
# Julius Zaromskis
# changes by http://dev-eth0.de
# Backup rotation
# Storage folder where to move backup files
# Must contain backup.monthly backup.weekly backup.daily folders
storage=/your/backup/folder
# Mail for notification if failed
@pebriana
pebriana / angular_data.html
Created April 27, 2016 04:22 — forked from MrSaints/angular_data.html
A simple AngularJS application to add / delete / list / sort data comprising of three fields (state code, price and tax). It was written to demonstrate to a friend, the simplicity and power of Angular to address programming challenges - in recruitment processes - quickly and effectively.
<!DOCTYPE html>
<html ng-app>
<head>
<title>Add / List Data (AngularJS)</title>
<style>
.list_data { margin-bottom: 2rem }
table, th, td { border: 1px solid #AAA }
th { cursor: pointer }
</style>
</head>
@pebriana
pebriana / how-to-install-arch-linux.md
Last active April 14, 2016 02:55
how-to-install-arch-linux

source: http://linuxscoop.com/video/how-to-install-arch-linux

Published on February 25, 2016 by lsteam

This video shown you step-by-step how to install arch linux. As we Know, Arch Linux is a simple and lightweight linux distribution targeted at competent Linux users. It uses ‘pacman’, its home-grown package manager, to provide updates to the latest software applications with full dependency tracking. Operating on a rolling release system, Arch can be installed from a CD image or via an FTP server.

The default install provides a solid base that enables users to create a custom installation. In addition, the Arch Build System (ABS) provides a way to easily build new packages, modify the configuration of stock packages, and share these packages with other users via the Arch Linux user repository.

#Step by Step Installing Arch Linux ##Before installing Arch Linux