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 / 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 / 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
@fer-ri
fer-ri / v-cloak.md
Created October 16, 2015 13:53 — forked from adamwathan/v-cloak.md
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@fer-ri
fer-ri / laravel.js
Last active October 18, 2021 12:45 — forked from soufianeEL/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Taken from: https://gist.github.com/soufianeEL/3f8483f0f3dc9e3ec5d9
Modified by Ferri Sutanto
- use promise for verifyConfirm
Examples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
<?php
/**
* This code demonstrates how to setup your application
* to intelligently handle errors of all types.
*/
ini_set('display_errors', 'Off');
error_reporting(0);
/**
@fer-ri
fer-ri / selenium-examples.py
Last active August 29, 2015 14:28 — forked from hugs/selenium-examples.py
Example code for using the Selenium 2 Python bindings.
# To install the Python client library:
# pip install -U selenium
# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver
# iPhone
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')
# Android
@fer-ri
fer-ri / wp.sh
Last active August 29, 2015 14:27 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@fer-ri
fer-ri / gist:e7db77ae0dc7d5f3b583
Last active August 29, 2015 14:27 — forked from thepsion5/gist:19ae573f6939ff40992f
Shell Script to run migrations and database seeders on a Laravel 4 application and dump the resulting DB contents to a SQL file
#!/bin/bash
#Retrieves an environment variable from the correct environment file
#Based on the specified environment
#Example: getEnvVariable local DB_USER VARIABLE
#Will attempt to retrieve the DB_USER array value from the file at .env.local.php
#And then store the result in VARIABLE
getEnvVariable(){
local RESULT=$3
local LOCAL_RESULT=$(php -r '
$file = getcwd() . "/.env." . trim($argv[1]) . ".php";
@fer-ri
fer-ri / .bash_profile
Last active August 29, 2015 14:26 — forked from JeffreyWay/.bash_profile
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"