Skip to content

Instantly share code, notes, and snippets.

@veob
veob / .bashrc
Last active August 29, 2015 14:27
TJ's bash aliases for git
alias gd="git diff"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gm="git merge --no-ff"
alias gpt="git push --tags"
alias gp="git push"
alias grh="git reset --hard"
alias gb="git branch"
@veob
veob / EmojiText.jsx
Created January 2, 2018 09:39
Render native emoji as emoji-mart components (quick solution)
const _ = require('lodash');
const React = require('react');
const propTypes = require('prop-types');
const {Emoji, emojiIndex} = require('emoji-mart');
// https://stackoverflow.com/a/45138005/3061229
const regexp = new RegExp(
'[\u{1f300}-\u{1f5ff}\u{1f900}-\u{1f9ff}\u{1f600}-\u{1f64f}' +
'\u{1f680}-\u{1f6ff}\u{2600}-\u{26ff}\u{2700}-\u{27bf}\u{1f1e6}' +
'-\u{1f1ff}\u{1f191}-\u{1f251}\u{1f004}\u{1f0cf}\u{1f170}-\u{1f171}' +
@veob
veob / cloudSettings
Last active June 4, 2018 15:34
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-06-04T15:34:26.165Z","extensionVersion":"v2.9.2"}
@veob
veob / setwebhook.js
Created January 30, 2020 10:21 — forked from imdkbj/setwebhook.js
Setup to listen telegram multiple bots on webhooks.
const axios = require('axios');
const apiurl = 'https://api.telegram.org/bot';
const serveraddress = 'https://yourdomain.com';
const tokens = ['3445345345:454545-iY_wE6wj_aKDJwKLXk', '453454545:gffgfgzbcfjhsdbflhjdsfvhjlvdsf'];
//set webhook
//you can make this as call as way you want.
webhookURL(tokens, 50, 8443, 'tgram');
async function webhookURL(bot_tokens, max_connections, port, from) {
@veob
veob / psql_naturalsort
Last active April 25, 2023 07:18
PostgreSQL natural sort
//sql
create or replace function naturalsort(text)
returns bytea language sql immutable strict as
$f$ select string_agg(convert_to(coalesce(r[2],length(length(r[1])::text) || length(r[1])::text || r[1]),'SQL_ASCII'),'\x00')
from regexp_matches($1, '0*([0-9]+)|([^0-9]+)', 'g') r; $f$;
//author: github.com/RhodiumToad