Skip to content

Instantly share code, notes, and snippets.

View fer-ri's full-sized avatar

Ferri Sutanto fer-ri

  • Purwokerto, Indonesia
View GitHub Profile
@fer-ri
fer-ri / screenshot.sh
Created October 18, 2017 01:27
Take screenshot from Youtube video at specific time in CLI mode
mpv https://www.youtube.com/watch?v=AxlZlM-M75E --no-audio --start=50% --frames=1 -o out.jpg
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#
@fer-ri
fer-ri / mysql-create-db-user.sh
Created September 3, 2017 10:03 — forked from MagePsycho/mysql-create-db-user.sh
Bash Script: Create MySQL Database & User
#!/bin/bash
#
# Script to create MySQL db + user
#
# @author Raj KB <[email protected]>
# @website http://www.magepsycho.com
# @version 0.1.0
################################################################################
@fer-ri
fer-ri / scrollTo.js
Created January 13, 2017 00:48 — forked from joshcanhelp/scrollTo.js
Animated scrollTo for specific element or top of page
//
// Smooth scroll-to inspired by:
// http://stackoverflow.com/a/24559613/728480
//
module.exports = function (scrollTo, scrollDuration) {
//
// Set a default for where we're scrolling to
//
@fer-ri
fer-ri / phpcs.sublime-settings
Created December 30, 2016 07:34
Sublime Setting For PHP Code Sniffer Package
{
// Do you want to run the phpcs checker?
"phpcs_sniffer_run": false,
// Execute the sniffer on file save
"phpcs_command_on_save": false,
"phpcs_executable_path": "/usr/local/bin/phpcs",
// Fix the issues on save
@fer-ri
fer-ri / letsencrypt.md
Last active September 29, 2017 08:10
VPS Setup Guide for Debian 8

Install letsencrypt / certbot in Debian 8 (Jessie)

nano /etc/apt/sources.list

## add the line to the end of file
deb http://ftp.debian.org/debian jessie-backports main

apt-get update
apt-get install certbot -t jessie-backports
@fer-ri
fer-ri / directives.php
Created December 8, 2016 10:16
Laravel Blade Directive To Set Active Menu Class
<?php
Blade::directive('active', function ($expression) {
return "<?php echo active_url($expression); ?>";
});
@fer-ri
fer-ri / phpcs.sublime-settings
Last active November 1, 2016 12:00
Setting that already complied with standard of Laravel and StyleCI. Demo https://github.com/ghprod/laravel-settings
{
// Do you want to run the phpcs checker?
"phpcs_sniffer_run": false,
// Execute the sniffer on file save
"phpcs_command_on_save": false,
"phpcs_executable_path": "/usr/local/bin/phpcs",
// Fix the issues on save
<style lang="sass" scoped>
.app {
position : relative;
width : 100vw;
height : 100vh;
margin : 0 !important;
}
.appbar {
position : absolute;
@fer-ri
fer-ri / image.php
Created June 25, 2016 22:04
Most Efficient Create Image Beacon / Web Bug / 1px Tracking With PHP
<?php
// based on http://stackoverflow.com/questions/4665960/most-efficient-way-to-display-a-1x1-gif-tracking-pixel-web-beacon
header('Content-Type: image/gif');
echo "\x47\x49\x46\x38\x37\x61\x1\x0\x1\x0\x80\x0\x0\xfc\x6a\x6c\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b";