Skip to content

Instantly share code, notes, and snippets.

View kyuumeitai's full-sized avatar

Álex Acuña Viera kyuumeitai

View GitHub Profile
@polymeris
polymeris / core.cljs
Last active June 24, 2023 03:39
re-frame + reagent + figwheel app running in the console
(ns hello-react-blessed.core
(:require
[cljs.nodejs :as nodejs]
[reagent.core :as reagent]
[re-frame.core :as rf]
[blessed :as blessed] ; or use neo-blessed
["react-blessed" :as rb]
[ws]))
(defonce logger (reagent/atom []))
@ramsunvtech
ramsunvtech / groupBy.js
Created September 25, 2018 15:07
Group By - ES6
function groupBy(list, props) {
return list.reduce((a, b) => {
(a[b[props]] = a[b[props]] || []).push(b);
return a;
}, {});
}
// Usage.
groupBy([{
id: 1,
@dentechy
dentechy / WSL-ssh-server.md
Last active July 14, 2024 03:54
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@jeremiegirault
jeremiegirault / README.md
Last active December 9, 2022 02:10
Use inline SVG in vue.js

Install svg-inline-loader for webpack :

npm install svg-inline-loader --save-dev

Add it to your loaders in module.loaders section of webpack.config.js:

{
  test: /\.svg$/,
 loader: 'svg-inline-loader'
@xenithorb
xenithorb / piwik-nginx.conf
Last active August 22, 2018 11:52
Piwik flat-file nginx configuration
#-*- mode: nginx; mode: flyspell-prog; mode: autopair; ispell-local-dictionary: "american" -*-
## Define a zone for limiting the number of simultaneous
## connections nginx accepts. 1m means 32000 simultaneous
## sessions. We need to define for each server the limit_conn
## value refering to this or other zones.
## ** This syntax requires nginx version >=
## ** 1.1.8. Cf. http://nginx.org/en/CHANGES. If using an older
## ** version then use the limit_zone directive below
## ** instead. Comment out this
## ** one if not using nginx version >= 1.1.8.
@souporserious
souporserious / react-scrollspy.js
Last active May 2, 2021 06:24
Two simple components to build a ScrollSpy in React
import React, { Component, PropTypes, createElement } from 'react'
import { findDOMNode } from 'react-dom'
// usage:
// import { ScrollSpy, Link } = './wherever-this-file-is'
//
// <ScrollSpy>
// <Link ref={c => this._firstLink = c} section="1">Section 1</Link>
// <Link section="2">Section 2</Link>
// <Link section="3">Section 3</Link>
@corysimmons
corysimmons / package.json
Created June 23, 2016 21:07
babel, sass, npm-run-all
{
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-0": "^6.5.0",
"node-sass": "^3.8.0",
"npm-run-all": "^2.2.2"
},
"babel": {
"presets": [
@punchi
punchi / validar_rut.php
Last active May 12, 2021 19:13 — forked from rbarrigav/validar_rut.php
Validar Rut en php
<?php
/**
* Comprueba si el rut ingresado es valido
* @param string $rut RUT
* @return boolean
*/
public function valida_rut($rut)
{
if (!preg_match("/^[0-9.]+[-]?+[0-9kK]{1}/", $rut)) {
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 16, 2024 15:33
Vanilla JavaScript Quick Reference / Cheatsheet
@tmocellin
tmocellin / React Scroll Event
Created August 3, 2015 14:05
Handle the scroll event in react js and change the navbar class when special section is on top of windows
var Hello = React.createClass({
getOffset : function(element){
var bounding = element.getBoundingClientRect();
return {
top: bounding.top + document.body.scrollTop,
left: bounding.left + document.body.scrollLeft
};
},