Skip to content

Instantly share code, notes, and snippets.

View wayanjimmy's full-sized avatar
🏠
Working from home

Wayan jimmy wayanjimmy

🏠
Working from home
View GitHub Profile
@wayanjimmy
wayanjimmy / Vagrantfile
Created January 31, 2015 06:26
vagrant scotchbox
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
@wayanjimmy
wayanjimmy / gulpfile.js
Created February 6, 2015 08:35
generic gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var notify = require('gulp-notify');
var gutil = require('gulp-util');
var browserSync = require('browser-sync');
gulp.task('less', function(){
return gulp.src(['./less/main.less'])
.pipe(less({ compress:true }).on('error', gutil.log))
.pipe(gulp.dest('./css'))
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed
@wayanjimmy
wayanjimmy / .zshrc
Created March 11, 2015 06:36
zshrc alias
alias work="cd ~/scotch-box && vagrant up"
alias in="cd ~/scotch-box && vagrant ssh"
alias go="cd ~/scotch-box/public"
alias home="cd ~/scotch-box && vagrant halt"
alias gpush="git push -u origin master"
alias gpull="git pull -u origin master"
alias l:serve="php artisan serve --host=192.168.33.10"
alias dream="sudo shutdown -h now"
alias android:cap="adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png"
@wayanjimmy
wayanjimmy / fix_brightness
Created March 24, 2015 02:17
Fix brightness Asus A455LD Ubuntu
sudo gedit /etc/default/grub
# change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# into
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="
#then
<body>
<p>Image to use:</p>
<img id="scream" width="64" height="64" src="http://placehold.it/64/55C1E7/fff&text=T" alt="The Scream">
<p>Canvas:</p>
<canvas id="myCanvas" width="500" height="800" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
# Ubuntu 15.04
# I'm using Zsh shell
# Node JS
sudo apt-get install python-software-properties
sudo apt-get install nodejs
sudo apt-get install npm
# Fix nodeJS
echo prefix = ~/.node >> ~/.npmrc
echo 'export PATH=$HOME/.node/bin:$PATH' >> ~/.zshrc
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed