Skip to content

Instantly share code, notes, and snippets.

View chibaye's full-sized avatar

chibaye chibaye

View GitHub Profile
@chibaye
chibaye / pulsate_path.css
Created May 7, 2019 18:59 — forked from lorenzoplanas/pulsate_path.css
Pulsating SVG Path
.pulsate path {
stroke: #2980b9;
-webkit-animation: pulsate 5s ease-out;
-webkit-animation-iteration-count: infinite;
-moz-animation: pulsate 5s ease-out;
-moz-animation-iteration-count: infinite;
-ms-animation: pulsate 5s ease-out;
-ms-animation-iteration-count: infinite;
animation: pulsate 5s ease-out;
animation-iteration-count: infinite;
@chibaye
chibaye / domain.tld.conf
Created May 20, 2019 15:11 — forked from natanfelles/domain.tld.conf
Nginx Virtual Host example to work on localhost
# Location: /etc/nginx/sites-available/domain.tld.conf
server {
listen 80;
# listen 443 ssl;
# include snippets/snakeoil.conf;
root /var/www/domain.tld/public;
index index.html index.php;

#Setting up Nginx on Your Local System ###by Keith Rosenberg

##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/

The command to type into terminal to install homebrew is:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@chibaye
chibaye / git-auto-deploy.md
Created August 30, 2019 14:07 — forked from yosukehasumi/git-auto-deploy.md
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy
@chibaye
chibaye / app.js
Created December 16, 2019 00:30 — forked from dskanth/app.js
Server file for Private chat using node.js and socket.io
var app = require('express').createServer()
var io = require('socket.io').listen(app);
var fs = require('fs');
app.listen(8008);
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});
@chibaye
chibaye / connect.js
Created December 30, 2019 13:00 — forked from gaearon/connect.js
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@chibaye
chibaye / next_nginx.md
Created January 2, 2020 19:34 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@chibaye
chibaye / CSVtoJSON.js
Created April 3, 2020 09:39 — forked from Jonarod/CSVtoJSON.js
Parse CSV and convert it to JSON with ES6
function CSVToMatrix(csv,delimiter){
let matrix = [];
csv.split('\n').map( l => { l.trim() == "" ? 0 : matrix.push(l.trim().split(delimiter).map(v=>v.trim())) })
return matrix
}
function MatrixToJSON(matrix,from,to){
let jsonResult = []; from = from||0;
matrix.map((a,i) => {
let obj = Object.assign({}, ...matrix[0].map((h, index) => ({[h]: matrix[i][index]})))
@chibaye
chibaye / nginx.conf
Created April 17, 2020 12:01 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@chibaye
chibaye / javascript-object-to-querystring.js
Created April 27, 2020 08:36 — forked from tjmehta/javascript-object-to-querystring.js
Object to Querystring - JavaScript, JS, JSON
function objectToQuerystring (obj) {
return Object.keys.reduce(function (str, key, i) {
var delimiter, val;
delimiter = (i === 0) ? '?' : '&';
key = encodeURIComponent(key);
val = encodeURIComponent(obj[key]);
return [str, delimiter, key, '=', val].join('');
}, '');
}