Skip to content

Instantly share code, notes, and snippets.

View danigunawan's full-sized avatar
🏸
sehat+i

Dani Gunawan danigunawan

🏸
sehat+i
View GitHub Profile
@danigunawan
danigunawan / index.md
Created December 10, 2017 08:48 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@danigunawan
danigunawan / RAILS_CHEATSHEET.md
Created December 10, 2017 08:53 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@danigunawan
danigunawan / deploy.rb
Created January 5, 2018 09:56 — forked from jhjguxin/deploy.rb
rails on ruby whenever demo
require "bundler/capistrano"
require "whenever/capistrano"
# RVM bootstrap
#$:.unshift(File .expand_path( "~/.rvm/lib" ))
set :rvm_ruby_string , 'ruby-1.9.3-p194@askjane' #这个值是你要用rvm的gemset。名字要和系统里有的要一样。
#set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system
set :rvm_type , :user # Don't use system-wide RVM
require 'rvm/capistrano'
@danigunawan
danigunawan / sublime_plugins.md
Created April 23, 2018 08:59 — forked from barnes7td/sublime_plugins.md
Sublime Plugins for Ruby and Rails

Sublime Plugins for Ruby and Rails

General

I would start by installing the Sublime Package Control manager. This tool will allow you to install the other plugins without having to clone git repositories and copying them to the correct folders. Instead you will the command drop-down menu with "Ctrl + Shift + P" and then scrolling down until you see "Package Control: Install Package". A search bar will pop up and you can type the name of a package, click on the name and it will self install. If you have problems setting any of these up email me at barnes7td@gmail.com

Packages/Plugins

  1. Sublime Package Control - Install this first. This tool will allow you to easily install most (if not all) the other plugins in this list. (Ctrl + Shift + P, then select Package Control: Install Package)

  2. SublimeERB - This plugin auto creates the erb tags. (<% %>, <%= %>, etc.) (Ctrl +

@danigunawan
danigunawan / remove_tuxera.sh
Created April 29, 2018 01:38 — forked from miguelmota/remove_tuxera.sh
Completely uninstall and remove Tuxera NTFS on MacOs (resets trial version)
rm -rf /Applications/Tuxera\ Disk\ Manager.app
rm -rf /Library/Application\ Support/Tuxera\ NTFS
rm -rf /Library/Filesystems/fusefs_txantfs.fs
@danigunawan
danigunawan / ajax_cheat_sheet.md
Created May 12, 2018 11:20 — forked from joelrojo/ajax_cheat_sheet.md
AJAX 101 cheat sheet

#AJAX

What is AJAX

"AJAX an acronym for asynchronous JavaScript and XML is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used instead), and the requests do not need to be asynchronous." - wikipedia

AJAX with jQuery

jQuery provides a $.ajax() method with a set of options for sending requests and callback methods to handle responses.

  • Here is the most basic $.ajax() request that does not send any data. It will be handled by the post '/trips' route on the server. You can choose any of the http request verbs for the type parameter (get, post, put, delete)
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/
@danigunawan
danigunawan / osx_setup.md
Created June 1, 2018 06:01 — forked from mcls/osx_setup.md
Setup mac for ruby dev
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/
@danigunawan
danigunawan / README-Template.md
Created June 17, 2018 17:11 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites