Skip to content

Instantly share code, notes, and snippets.

View tenclar's full-sized avatar
:atom:

Tenclar Valus tenclar

:atom:
View GitHub Profile
@baumandm
baumandm / Chakra-UI x React-datepicker.md
Last active May 29, 2024 05:29
Chakra-UI x React-datepicker

⚠️ I'd recommend using this fork by @igoro00 which has better theme support.


Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />
@fortwo
fortwo / groupByMultipleKeys.js
Last active November 26, 2020 21:10
Based on the very well written https://gist.github.com/robmathers/1830ce09695f759bf2c4df15c29dd22d, this is a groupBy method that supports multiple keys.
const groupBy = (data, keys) => { // `data` is an array of objects, `keys` is the array of keys (or property accessor) to group by
// reduce runs this anonymous function on each element of `data` (the `item` parameter,
// returning the `storage` parameter at the end
return data.reduce((storage, item) => {
// returns an object containing keys and values of each item
const groupValues = keys.reduce((values, key) => {
values[key] = item[key];
return values;
}, {});
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@jjvillavicencio
jjvillavicencio / setup.sh
Last active August 8, 2025 01:16
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@simonrenoult
simonrenoult / sanitize.js
Last active February 23, 2024 08:42
Recursive trim of objects and arrays using lodash
function sanitize(object) {
if (_.isString(object)) return _sanitizeString(object);
if (_.isArray(object)) return _sanitizeArray(object);
if (_.isPlainObject(object)) return _sanitizeObject(object);
return object;
}
function _sanitizeString(string) {
return _.isEmpty(string) ? null : string;
}
@ywwwtseng
ywwwtseng / host-react-app-on-apache-server.md
Last active August 5, 2025 18:26
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@harv
harv / glibc-2.17_centos6.sh
Last active June 20, 2025 05:10
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@arulprabakaran
arulprabakaran / Sublime Text 3 Build 3126 Keys.md
Last active October 22, 2024 13:23
Sublime text 3 (Build 3126) license key.

Sublime text 3 (Build 3126) license key,these all tested available on 2016/09/23.

##Feel free to enjoy them.

—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
@jamesmorrison
jamesmorrison / wordpress-random-post-slug.php
Last active June 7, 2021 04:56
Replace the default WP post slug with a random one in the format is "XXXX-XXXX-XXXX-XXXX"
<?php
/**
*
* Filter post slug
* This needs saving as post meta to use that value rather than regenerate a new one
*
**/
add_filter( 'wp_unique_post_slug', function( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
@alexandreaquiles
alexandreaquiles / Context.xml
Last active March 2, 2017 21:54
Configurando um DataSource com JNDI no Spring.
<!-- no diretorio de instalacao do Tomcat -->
<Resource name="jdbc/dataSource" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/fj21"/>