Skip to content

Instantly share code, notes, and snippets.

View ccfiel's full-sized avatar

Chris Ian Fiel ccfiel

View GitHub Profile
@ccfiel
ccfiel / gist:5831851
Created June 21, 2013 15:09
sample of prepend bootstrap
<div class="control-group">
<label class="control-label" for="inputIcon">Email address</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-envelope"></i></span>
<input class="span2" id="inputIcon" type="text">
</div>
</div>
</div>
@ccfiel
ccfiel / gist:5882006
Created June 28, 2013 02:24
Angular-Notifications
angular.module('notifications', []).factory('$notification', [
'$timeout',
function ($timeout) {
console.log('notification service online');
var notifications = JSON.parse(localStorage.getItem('$notifications')) || [], queue = [];
var settings = {
info: {
duration: 5000,
enabled: true
},
@ccfiel
ccfiel / Sails JS
Created November 14, 2014 00:00
Sails init.d
#!/bin/bash
#
# An init.d script for running a Node.js process as a service using Forever as
# the process monitor. For more configuration options associated with Forever,
# see: https://github.com/nodejitsu/forever
#
# This was written for Debian distributions such as Ubuntu, but should still
# work on RedHat, Fedora, or other RPM-based distributions, since none of the
# built-in service functions are used. So information is provided for both.
#
<div class="container-fluid" ng-app="receta">
<div class="panel panel-success">
<div class="panel-heading">
<h1 ng-if="name">Hello, {{name}}</h1>
</div>
<div class="panel-body">
<form class="form-inline">
<div class="form-group">
<input class="form-control" type="text" placeholder="Enter your name" autofocus ng-model="name">
</div>
Router.route '/',
name: 'home'
waitOn: ->
Meteor.subscribe 'Stocks'
action: ->
@render 'home', data: products: Products.find {}
SEO.set title: 'Home - ' + Meteor.App.NAME
return
onAfterAction: ->
routerInstance = this
Router.route '/',
name: 'home'
waitOn: ->
Meteor.subscribe 'Stocks'
action: ->
@render 'home', data: products: Products.find {}
SEO.set title: 'Home - ' + Meteor.App.NAME
return
onAfterAction: ->
routerInstance = this
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
from Tkinter import *
from PIL import Image, ImageTk
import os
import datetime
class App(object):
def __init__(self):
self.root = Tk()
self.id_number = ""
function toggle_fields(frm) {
frm.toggle_reqd("customer", frm.doc.transaction_type == "Rent");
frm.toggle_reqd("deposit_amount", frm.doc.transaction_type == "Rent");
frm.toggle_display("customer", frm.doc.transaction_type == "Rent");
frm.toggle_display("deposit_amount", frm.doc.transaction_type == "Rent");
frm.toggle_reqd("tenant", frm.doc.transaction_type == "Vacate");
frm.toggle_reqd("balance", frm.doc.transaction_type == "Vacate");
frm.toggle_display("tenant", frm.doc.transaction_type == "Vacate");
frm.toggle_display("balance", frm.doc.transaction_type == "Vacate");
console.log("oooooooooooooooooooooo");
frappe.ui.form.on("Enrollees", "status", function(frm) {
frm.toggle_display("student", frm.doc.status == "Continuing" || frm.doc.status == "Returnee");
return frappe.call({
method: "wela.registration.doctype.enrollees.enrollees.generate_id_number",
args: {
"status": frm.doc.status
},
callback: function(r, rt) {
if(r.message) {