Skip to content

Instantly share code, notes, and snippets.

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

Coco R tchalvak

🐙
making another SPA
View GitHub Profile
@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

@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;
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
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.
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();
<?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;
@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;
@tchalvak
tchalvak / WhatTheFuckLNWhyDoYouActThisWay
Created December 29, 2014 18:36
WhatTheFuckLNWhyDoYouActThisWay
mkdir temp
cd temp
mkdir deploy
echo "Contents of the build file!" > deploy/resources.build.php
ln -s deploy/resources.build.php deploy/resources.php
cat deploy/resources.php
echo "That cat should work, but it doesn't, how the flip do people create symlinks in subdirectories then? So weird."
@tchalvak
tchalvak / nw.sql
Created July 12, 2013 19:33 — forked from toopay/nw.sql
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
@tchalvak
tchalvak / cakepi.php
Created August 6, 2012 16:01
Simple Programming task
<?php
/*
Using php, write a program that must fulfill these requirements:
For the numbers from 1 to 100,
If the number is a multiple of 3, print cake instead of the number.
If the number is a multiple of 5, print pi instead of the number.
If the number is a multiple of both 3 and 5, print cakepi instead of the number.