Skip to content

Instantly share code, notes, and snippets.

Chris Ian Fiel ccfiel

  • Cagayan de Oro
View GitHub Profile
View auth.dart
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:localstorage/localstorage.dart';
enum Platform { ios, android }
const TOKEN_STORAGE = "colyseus-auth-token";
@ccfiel
ccfiel / auth.dart
Created Sep 1, 2019
colyseus auth to dart
View auth.dart
import 'dart:io';
import 'package:http/http.dart' as http;
class Auth {
String token;
String endpoint;
Auth(String _endpoint) {
endpoint = _endpoint.replaceAll("ws", "http");
View options
[0] WebSocket {
[0] domain: null,
[0] _events:
[0] { close: [ [Function], [Object] ],
[0] error: [Function],
[0] pong: [Function: heartbeat] },
[0] _eventsCount: 3,
[0] _maxListeners: undefined,
[0] readyState: 1,
[0] protocol: '',
View backlight
#!/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
View pusoy
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),
]));
View main.dart
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 Jun 13, 2018 — forked from peterp/README.md
Installing React-Native on Ubuntu
View README.md

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
View test.lua
-- 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")
View anecdotal_note.js
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"]);
}
View enrollees.js
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') {
You can’t perform that action at this time.