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 / android_application_class.java
Created June 25, 2015 09:38
Sample Android Application Class
package io.jirra.android.managers;
import android.app.Application;
import com.mikepenz.community_material_typeface_library.CommunityMaterial;
import com.mikepenz.iconics.Iconics;
public class JirraApp extends Application {
public JirraApp() {
@wayanjimmy
wayanjimmy / deploy.rb
Last active August 29, 2015 14:26 — forked from mul14/deploy.rb
Deploy Laravel 4 with mina http://mina-deploy.github.io/mina/
require 'mina/git'
# Fix the SSH password prompt problem
set :term_mode, nil
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
# branch - Branch name to deploy. (needed by mina/git)
@wayanjimmy
wayanjimmy / basicSelect.php
Last active August 29, 2015 14:27 — forked from basdenooijer/basicSelect.php
Solarium select examples
<?php
// A query without any settings will use default values.
// This will result in a "*:*" query, 10 rows, all fields.
$query = new Solarium_Query_Select;
$result = $client->select($query);
echo 'Number of results found: ' . $result->getNumFound();
// The resultset is iterable, you could also use $result->getDocuments() to get an array with documents.
@wayanjimmy
wayanjimmy / http_response.php
Created September 18, 2015 08:06
Http response
<?php
/**
* get string representation of HTTP message from HTTP response code
* @param int $code
* @return string
* @throws Exception
*/
function http_response_message($code)
{
switch ($code) {
@wayanjimmy
wayanjimmy / node-and-npm-in-30-seconds.sh
Created October 8, 2015 10:12 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@wayanjimmy
wayanjimmy / genymotion_etc_hosts.sh
Created October 13, 2015 07:22
Push genymotion /etc/hosts
adb root && adb remount && adb push /etc/hosts /system/etc
@wayanjimmy
wayanjimmy / fix_gitignore.sh
Last active October 21, 2015 05:41
Fix gitignore
git rm -r --cached . && git add . && git commit -m "fixing .gitignore"
@wayanjimmy
wayanjimmy / import_redis.sh
Created October 22, 2015 03:02
Import redis
#http://stackoverflow.com/questions/6004915/how-do-i-move-a-redis-database-from-one-server-to-another
B$ sudo service redis-server stop
B$ sudo cp /tmp/dump.rdb /var/lib/redis/dump.rdb
B$ sudo chown redis: /var/lib/redis/dump.rdb
B$ sudo service redis-server start
@wayanjimmy
wayanjimmy / xinput.sh
Created October 28, 2015 02:32
Disable touchpad
xinput #list devices
xinput set-prop 13 'Device Enabled' 0 #disabled
xinput set-prop 13 'Device Enabled' 1 #enabled
@wayanjimmy
wayanjimmy / gosublime.json
Created January 10, 2016 11:48
GoSublime user setting
{
"env": {
"GOPATH": "$HOME/gogo",
"PATH": "$GOPATH/bin:$PATH"
},
"fmt_cmd": [
"goimports"
],
"comp_lint_enabled": true,
"comp_lint_commands": [