Skip to content

Instantly share code, notes, and snippets.

View ccfiel's full-sized avatar

Chris Ian Fiel ccfiel

View GitHub Profile
#!/bin/bash
WORKDIR=/home/chris/
LOGFILE=/tmp/backlight.log
KBDBACKLIGHT=`cat /sys/devices/platform/asus-nb-wmi/leds/asus::kbd_backlight/brightness`
HOUR=`date +%H`
echo "---------------->" | tee -a $LOGFILE
const north = new Player('north', new Hand([
new PlayingCard(CardName.Jack, Suit.Diamonds),
new PlayingCard(CardName.Jack, Suit.Hearts),
new PlayingCard(CardName.Queen, Suit.Clubs),
]));
const east = new Player('east', new Hand([
new PlayingCard(CardName.King, Suit.Diamonds),
new PlayingCard(CardName.Nine, Suit.Spades),
new PlayingCard(CardName.Two, Suit.Hearts),
]));
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@ccfiel
ccfiel / README.md
Last active June 13, 2018 00:13
Installing React-Native on Ubuntu

First, you'll need NodeJS and NPM:

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
nodejs -v
v8.4.0
-- main.lua --
conta = 0
litro = 0
pin = 2 --> GPIO4
-- Connect
print('\nInitializing...main.lua\n')
tmr.alarm(0, 1000, 1, function()
if wifi.sta.getip() == nil then
print("Connecting to AP...\n")
@ccfiel
ccfiel / anecdotal_note.js
Created July 26, 2016 04:22
sample java
frappe.ui.form.on("Anecdotal Note", "student", function (frm, cdt, cdn) {
frappe.call({
method: "wela.disciplinary_notes.doctype.anecdotal_note.anecdotal_note.get_student_summary",
args: {
"student": frm.doc.student
},
callback: function (r) {
frm.set_value("summary", r.message["result"]);
frm.set_value("contact_numbers", r.message["contact_numbers"]);
}
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) {
if (frm.doc.status == 'New' || frm.doc.status == 'Transferee') {
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) {
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");
from Tkinter import *
from PIL import Image, ImageTk
import os
import datetime
class App(object):
def __init__(self):
self.root = Tk()
self.id_number = ""