Skip to content

Instantly share code, notes, and snippets.

View tokoiwesley's full-sized avatar

Wesley Tokoi tokoiwesley

View GitHub Profile
// Bonfire: Sum All Numbers in a Range
// Author: @tokoiwesley
// Challenge: http://www.freecodecamp.com/challenges/bonfire-sum-all-numbers-in-a-range?solution=function%20sumAll(arr)%20%7B%0A%20%20var%20valA%20%3D%20arr%5B0%5D%3B%0A%20%20var%20valB%20%3D%20arr%5B1%5D%3B%0A%20%20%0A%20%20var%20max%20%3D%20Math.max(valA%2CvalB)%3B%0A%20%20var%20min%20%3D%20Math.min(valA%2CvalB)%3B%0A%20%20%0A%20%20var%20newArr%20%3D%20%5B%5D%3B%0A%20%20%0A%20%20for%20(i%3Dmin%3B%20i%20%3C%3D%20max%3B%20i%2B%2B)%20%7B%0A%20%20%20%20newArr.push(i)%3B%0A%20%20%7D%0A%20%20%20%0A%20%20return%20newArr.reduce(function(previousValue%2C%20currentValue%2C%20index%2C%20array)%7B%0A%20%20%20%20return%20previousValue%20%2B%20currentValue%3B%0A%20%20%7D)%3B%0A%7D%0A%0AsumAll(%5B1%2C%204%5D)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function sumAll(arr) {
var valA = arr[0];
var valB = arr[1];
var max = Math.max(valA,valB);
@tokoiwesley
tokoiwesley / sysctl.conf
Last active June 3, 2017 17:42
Increasing inotify watches limit on Ubuntu 16.04 after inotify resources are exhausted - limit is reached
# Add the following line to /etc/sysctl.conf file
# fs.inotify.max_user_watches = 524288
#
# Then run this command to apply the change:
# sudo sysctl -p --system
#
fs.inotify.max_user_watches = 524288
@tokoiwesley
tokoiwesley / Install PHP 7.1 on Debian Stretch
Last active June 19, 2024 01:03
How To Install Php 7.1 On Debian
# Add Repository to your system (ondrej/php PPA)
sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
# Install PHP 7.1
sudo apt install php7.1
@tokoiwesley
tokoiwesley / semantic-ui.blade.php
Last active February 14, 2018 08:43
Semantic UI Pagination in Laravel
<?php
/**
* Semantic UI
* Includes previous and next buttons
* @example $pages->links('vendor.pagination.semantic-ui', ['paginator' => $pages])
* @example @include('vendor.pagination.semantic-ui', ['paginator' => $pages])
*
* @link https://semantic-ui.com/collections/menu.html#inverted Inverted styles
* @see <div class="ui pagination inverted blue menu"> Inverted blue menu
**/
@tokoiwesley
tokoiwesley / simple-semantic-ui.blade.php
Created February 14, 2018 08:45
Simple Semantic UI Pagination in Laravel
<?php
/**
* Semantic UI
* @example $pages->links('vendor.pagination.simple-semantic-ui', ['paginator' => $pages])
* @example @include('vendor.pagination.simple-semantic-ui', ['paginator' => $pages])
**/
?>
@if ($paginator->lastPage() > 1)
<div class="ui pagination menu">
@for ($i = 1; $i <= $paginator->lastPage(); $i++)

Keybase proof

I hereby claim:

  • I am tokoiwesley on github.
  • I am tokoiwesley (https://keybase.io/tokoiwesley) on keybase.
  • I have a public key ASD9o4EvfAUCkBK2xITLfApK32fyIPl6Pf4n3ZWYJli2jAo

To claim this, I am signing this object:

Solution:
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
&& sudo dpkg -i /tmp/libpng12.deb \
&& sudo rm /tmp/libpng12.deb
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Path=/opt/Postman
Exec=/opt/Postman/Postman
StartupNotify=false
StartupWMClass=Postman
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#