Skip to content

Instantly share code, notes, and snippets.

🐙
refactoring a react site

Roy R. tchalvak

View GitHub Profile
@tchalvak
tchalvak / bluejeans_rpm_via_alien.md
Last active Jan 19, 2018 — forked from johnduarte/bluejeans_rpm_via_alien.md
BlueJeans rpm install on Debian
View bluejeans_rpm_via_alien.md

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 Dec 22, 2017 — forked from paulirish/bling.js
bling dot js
View bling.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;
View gist:0ebd5c843ffbf0aabf4c08b3f88d7804
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
View Create a simple chat app
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.
View NoJuice4u.js
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();
View Simpler recursive 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;
View 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 Dec 29, 2014
WhatTheFuckLNWhyDoYouActThisWay
View 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."
View 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 Aug 6, 2012
Simple Programming task
View cakepi.php
<?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.
You can’t perform that action at this time.