Skip to content

Instantly share code, notes, and snippets.

View fnk0's full-sized avatar

Marcus Gabilheri fnk0

  • Snap
  • Los Angeles, CA
View GitHub Profile
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.frame_container, new MyFragment()).commit();
<div class="widget col-lg-4">
<div class="widget-head br-green">
<h3><i class="fa fa-desktop"></i> <b>{{ computer.computer.make }} - </b> {{ computer.computer.benchid }}</h3>
</div>
<div class="widget-body">
<p>Processor: {{ computer.computer.processor }}</p>
<p>Ram: {{ computer.computer.ram }}</p>
<p>Hard Drive: {{ computer.computer.hard_drive }}</p>
<p>Serial Number: {{ computer.computer.serial_number }}</p>
app.directive('computer', function() {
return {
restrict: 'E',
templateUrl: '/assets/html/computer.html'
};
});
app.controller('WorkbenchController', ['$http', function($http){
var workbenches = this;
workbenches.computers = [];
workbenches.getWorkbenchName = function(workbenchNumber) {
switch(workbenchNumber) {
case 1:
return "Workbench #1";
case 2:
return "Workbench #2";
<section ng-controller="WorkbenchController as workbench">
<div class="ui-element-container">
<ul id="workbenches" class="nav nav-tabs">
<li ng-class="{ active: tab.isSelected(0) }"><a href ng-click="tab.selectTab(0)">All the computers.</a></li>
<li ng-class="{ active: tab.isSelected(1) }"><a href ng-click="tab.selectTab(1)">Workbench #1</a></li>
<li ng-class="{ active: tab.isSelected(2) }"><a href ng-click="tab.selectTab(2)">Workbench #2</a></li>
<li ng-class="{ active: tab.isSelected(3) }"><a href ng-click="tab.selectTab(3)">Workbench #3</a></li>
<li ng-class="{ active: tab.isSelected(4) }"><a href ng-click="tab.selectTab(4)">Workbench #4</a></li>
<li ng-class="{ active: tab.isSelected(5) }"><a href ng-click="tab.selectTab(5)">Laptop Workbench</a></li>
<li ng-class="{ active: tab.isSelected(6) }"><a href ng-click="tab.selectTab(6)">Danie's Desk</a></li>
@fnk0
fnk0 / Drawer selector
Last active August 29, 2015 14:06
Drawer Layout activity
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<shape>
<solid android:color="@color/drawer_selected" />
</shape>
</item>
<item android:state_pressed="true">
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]'
# into your database.
from __future__ import unicode_literals
@fnk0
fnk0 / PostFixCalc.java
Created October 28, 2014 02:42
RPN Calculator Java
import java.util.*;
public class PostfixCalc {
// Commands
private static final String QUIT = "quit";
private static final String VAR = "var";
private static final String CLEAR = "clear";
private static ArrayList<String> variableNames = new ArrayList<String>();
package gabilheri.com.library;
import android.util.Log;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
public class SettingsAcrivity extends ActionBarActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}