Skip to content

Instantly share code, notes, and snippets.

View addingama's full-sized avatar

Addin Gama Bertaqwa addingama

View GitHub Profile
@addingama
addingama / menu
Created September 9, 2013 20:25
sql dump for menu
DROP TABLE IF EXISTS `menu`;
CREATE TABLE IF NOT EXISTS `menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`submenu_of` int(10) DEFAULT '0',
`urutan` int(4) unsigned DEFAULT '0',
`idmenu` int(10) DEFAULT NULL,
`label` varchar(50) DEFAULT NULL,
`level` int(2) unsigned DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`main_menu` tinyint(1) DEFAULT '1',
@addingama
addingama / RelativeLayout Click
Created September 19, 2014 03:29
Relative Layout On Click Listener
package com.wgs.clink;
import com.wgs.clink.util.OnSwipeTouchListener;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.LayoutInflater;
Dash Racer@DASHRACER-PC /c/wamp/www/clink (master)
$ node server.js
module.js:340
throw err;
^
Error: Cannot find module 'bitcore'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
vagrant@vagrant-ubuntu-trusty-64:/var/www/vagrant$ sudo npm install -g n n s
table
npm http GET https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/stable
npm http 304 https://registry.npmjs.org/n
npm http 304 https://registry.npmjs.org/stable
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
stable@0.1.5 /usr/local/lib/node_modules/stable
n@1.2.13 /usr/local/lib/node_modules/n
// ini di dalam adapter. class view holder di buat jadi inner class
static class ViewHolder {
TextView name;
TextView meter;
TextView statusMeter;
TextView statusSegel;
TextView statusData;
TextView id;
ImageView fotoMeter;
LinearLayout btn_delete;
// WpUser.php model
<?php
App::uses('AppModel', 'Model');
require(DIRNAME(ROOT).WP_DIR.'wp-load.php');
class WpUser extends AppModel {
}
// User controller: login
public function login() {
@addingama
addingama / ESP8266 With Modified Header
Created June 12, 2015 06:57
ESP8266 With Modified Header
-- format program untuk konek ke geeknesia.com
conn=net.createConnection(net.TCP, 0)
conn:connect(3000,'54.179.149.183')
conn:send("GET /api/data?attributes={\"motion\":\""..pinState.."\"}\r\n\r\n")
conn:send("api_key : "..API_KEY.."\r\n\r\n")
end
@addingama
addingama / ArduinoCustomHeader
Created June 12, 2015 10:28
CUstom header untuk menyembunyikan api key pada header
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
// Update these with values suitable for your network.
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
byte ip[] = { 192, 168, 137, 2 };
byte dns2[] = {8, 8, 8, 8};
byte gateway[] = { 192, 168, 137, 1 };
String api_key = "API_KEY";
@addingama
addingama / vhost-laravel.conf
Created April 10, 2016 10:56
Sample vhost for laravel
<VirtualHost *:80>
ServerName domain.com
ServerAlias domain.com
ServerAdmin support@domain.com
DocumentRoot /home/deploy/domain-dir/public
<Directory /home/deploy/domain-dir/public>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
{
"font_size": 16,
"translate_tabs_to_spaces": true,
"indent_to_bracket": true,
"highlight_line": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"shift_tab_unindent": true,
"copy_with_empty_selection": false,
"drag_text": false,