Skip to content

Instantly share code, notes, and snippets.

View raymelon's full-sized avatar
👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋

Raymel raymelon

👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋
View GitHub Profile
@shahnawaz
shahnawaz / barcode-mask-example-3.jsx
Last active June 18, 2024 05:01
react-native-barcode-mask example usage
import React from "react";
import {
Text,
View,
Item,
Icon,
Input,
Button
} from 'native-base';
import { KeyboardAvoidingView } from "react-native";
@AllanPooley
AllanPooley / moment-greetings.js
Created October 9, 2018 09:59
Time based user greetings (Good Morning, Afternoon, Evening) using moment.js
getGreetingTime = (currentTime) => {
if (!currentTime || !currentTime.isValid()) { return 'Hello'; }
const splitAfternoon = 12; // 24hr time to split the afternoon
const splitEvening = 17; // 24hr time to split the evening
const currentHour = parseFloat(currentTime.format('HH'));
if (currentHour >= splitAfternoon && currentHour <= splitEvening) {
// Between 12 PM and 5PM
return 'Good afternoon';
@mraaroncruz
mraaroncruz / steps.md
Last active April 23, 2026 01:32
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

@gorbatova
gorbatova / commit-msg
Last active October 31, 2023 22:43
Add timestamp and branch name to GIT commit message
# Step 1: Go to .git/hooks/ directory
# Step 2: Rename "commit-msg.sample" to "commit-msg" (CLI: mv commit-msg.sample commit-msg)
# Step 3: Replace the existing code in a "commit-msg" file with the following code
NAME=$(git branch | grep '*' | sed 's/* //')
TIMESTAMP=$(date +"%D %T")
DESCRIPTION=$(git config branch."$NAME".description)
echo "$TIMESTAMP — $NAME"': '$(cat "$1") > "$1"
if [ -n "$DESCRIPTION" ]
then
echo "" >> "$1"

Install npm module

npm install react-native-maps --save

Top-Level build.gradle

add google() and change classpath com.android.tools.build:gradle:3.0.1

// Top-level build file where you can add configuration options common to all sub-projects/modules.
@njanakiev
njanakiev / watchdog_example.py
Created February 19, 2018 11:10
Simple example of monitoring file system events in Python with the watchdog module
import sys
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class EventHandler(FileSystemEventHandler):
def on_any_event(self, event):
print("EVENT")
print(event.event_type)
print(event.src_path)
print()
@Meandmybadself
Meandmybadself / FontAwesome5.json
Created January 4, 2018 17:38
Font Awesome 5 glyph map
{
"500px": 62062,
"accessible-icon": 62312,
"accusoft": 62313,
"address-book": 62137,
"address-card": 62139,
"adjust": 61506,
"adn": 61808,
"adversal": 62314,
"affiliatetheme": 62315,
@akexorcist
akexorcist / index.js
Last active September 13, 2024 19:03
Axios post method requesting with x-www-form-urlencoded content type. See https://axios-http.com/docs/urlencoded
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)
@jacks205
jacks205 / RNMultipleTargetsInstructions.md
Last active July 29, 2025 08:20
Settings up multiple app targets in React-Native
# Import a bunch of models
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn.neighbors import KNeighborsRegressor
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.cross_decomposition import PLSRegression
from sklearn.ensemble import AdaBoostRegressor