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 / mirror.md
Last active November 5, 2021 11:06
Mirror Website Using Httrack Command Line
mkdir ~/Mirror

cd ~/Mirror

httrack --connection-per-second=8 --sockets=8 --keep-alive --display --verbose --advanced-progressinfo --disable-security-limits -i -s0 -m -F 'Mozilla/5.0 (X11;U; Linux i686; en-GB; rv:1.9.1) Gecko/20090624 Ubuntu/9.04 (jaunty) Firefox/3.5' -#L999999 http://domain.com
@fer-ri
fer-ri / Example.php
Created January 19, 2016 06:14
Spinner PHP Class With Seed
<?php
$string = '{{The|A}} {{quick|speedy|fast}} {{brown|black|red}} {{fox|wolf}} {{jumped|bounded|hopped|skipped}} over the {{lazy|tired}} {{dog|hound}}';
echo '<p>';
for($i = 1; $i <= 5; $i++)
{
echo Spinner::detect($string, false).'<br />';
// or Spinner::flat($string, false).'<br />';
@fer-ri
fer-ri / spintax.php
Created January 19, 2016 06:12 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
*/
class Spintax
{
public function process($text)
@fer-ri
fer-ri / how to clean dishwasher.md
Created January 7, 2016 15:32
How To Clean Dishwasher? Follow This Step By Step Guide

How To Clean Dishwasher? Follow This Step By Step Guide

Do you ever think about how to clean a dishwasher? Maybe it’s a little bit strange at the first time. Why do i need to clean something that is for cleaning something? Remember, dishwasher is a machine that’s need some treatment to make it keep smooth when doing the job and its not enough just with hot water and soap only. Because leftover food scraps and other grime doesn’t magically disappear. Keeping the dishwasher in your kitchen stays clean will give you a lot of benefit. For example, this will extend the service life of your machine and all dishes remains hygienic.

Now prepare yourself, and read this guide how to clean dishwasher step by step.

What you need?

1 cup distilled white vinegar. This is one of the most versatile liquids in our life except water of course. We can also use it for cooking and killing weeds! 1 cup baking soda. Combination between baking soda and white vinegar will give you super clean

@fer-ri
fer-ri / helpers.php
Created January 2, 2016 19:14
Laravel env() Helper Without Framework
<?php
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function env($key, $default = null)
{
@fer-ri
fer-ri / gist:76b8079c6c05878797b5
Created December 20, 2015 10:15 — forked from pawelmhm/gist:8917867
Scrapy spider crawling Stack Overflow
from scrapy.spider import Spider
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.item import Item, Field
import urllib
class Question(Item):
tags = Field()
answers = Field()
@fer-ri
fer-ri / install.md
Created November 9, 2015 15:31 — forked from brunogaspar/install.md
Sentry 3 Users Online

Step 1

Open the file app/config/session.php and change the driver to database.

Step 2

We need to create the sessions table, so use the following artisan command php artisan session:table to generate the migration file.

Step 3

@fer-ri
fer-ri / transfer.fish
Created November 8, 2015 19:56 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@fer-ri
fer-ri / options.conf
Last active November 8, 2015 09:22
Tuxlite options.conf
# Hostname can be anything. E.g. "vps", "zeus", "jupiter"
# FQDN can be any domain that you own and doesn't have to be hosted on this server
HOSTNAME=rafa
HOSTNAME_FQDN=sub.domain.com
SERVER_IP="0.0.0.0"
SSHD_PORT=22
# Set an admin email account to be used for various system notifications and alerts
ADMIN_EMAIL="[email protected]"
@fer-ri
fer-ri / behat-reference.feature
Created November 4, 2015 19:22 — forked from mnapoli/behat-reference.feature
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page