Skip to content

Instantly share code, notes, and snippets.

View tchalvak's full-sized avatar
🐙
making another SPA

Roy R. tchalvak

🐙
making another SPA
View GitHub Profile
@tchalvak
tchalvak / recursive_integer_maximum
Created April 8, 2015 15:00
recursive_integer_maximum
<?php
// Recursively determine the max
// Does not handle badly formed input
// Not yet optimized for performance
function my_max( $data ) {
$max = null;
foreach($data as $elem){
$new_max = is_array($elem)? my_max($elem) : $elem;
$max = $new_max > $max? $new_max : $max;
<?php
// Recursively determine the max
// Does not handle badly formed input
// Not yet optimized for performance
function my_max( $data ) {
if(is_int($data)){
return $data; // end of the line, just return the int
}
$max = null;
var myTeam = this.team;
var eSoldiers = [];
var itemUpdateDelay = 0.5;
var itemTimer = 0;
var soldiersCount = 0;
var goldStormCD = 0;
var firstBlast = true;
var initiate = false;
var atkType = 2;
var manaBlastCD = this.now();
Show us how you would code a simple web chat application!
As a web developer, you've certainly used a web chat before, and maybe you have even coded one before.
Let's see if you can use these customer/client stories, and all your skills as a dev, to create a nice, simple chat app.
Here are the stories:
- As a customer, Bob want to chat on the website with other customers, so he can be part of the community.
- As a customer, Jane wants to choose a username, send some chat messages, and see her chats even after a page reload.
- As a corporate admininstrator, Greg wants the chat to get a nice initially designed template, so he can can present it as part of a corporate retreat.
function series(state = {}, action) {
switch (action.type) {
case RECEIVE_SERIES_DATA:
const series = action.data.length ? action.data : [action.data]
return series.reduce((acc, series) => {
return Object.assign({}, acc, { [series.unique_key] : series })
}, state)
default:
return state
@tchalvak
tchalvak / bling.js
Created December 22, 2017 23:02 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@tchalvak
tchalvak / bluejeans_rpm_via_alien.md
Last active January 19, 2018 16:45 — forked from johnduarte/bluejeans_rpm_via_alien.md
BlueJeans rpm install on Debian

FYI, for those of us not running Debian based systems rather than RedHat, the BlueJeans RPM can be successfully installed via alien

Steps to install BlueJeans on Debian

  • Download BlueJeans RPM
  • Install alien package sudo apt-get install alien
  • Convert BlueJeans RPM to a DEB package sudo alien --to-deb --scripts bluejeans-*.rpm
  • Install resulting DEB sudo dpkg -i bluejeans_*.deb
  • Run BlueJeans with /opt/bluejeans/bluejeans-bin

You may get an error loading the expected udev library