Skip to content

Instantly share code, notes, and snippets.

View lukeramsden's full-sized avatar

Luke Ramsden lukeramsden

View GitHub Profile
@artyorsh
artyorsh / mapping.json
Last active March 24, 2024 15:54
Time Picker example with UI Kitten and DateTimePicker
{
"components": {
"Timepicker": {
"meta": {
"scope": "all",
"parameters": {
"minHeight": {
"type": "number"
},
"paddingHorizontal": {
import {reconcile} from './utils/reconcile.mjs'
import {bar} from './bar-component.mjs'
import {baz} from './baz-component.mjs'
export const app = () => {
/// This is a component; it creates a node, sets some invariant properties on
/// that node (e.g., handler functions, sometimes CSS classes, &c.).
/// => any => Object
@huntie
huntie / metro.config.js
Last active July 10, 2023 01:53
Snippets accompanying my article "A concise guide to configuring React Native with Yarn Workspaces" on Medium
/**
* Metro Bundler configuration
* https://facebook.github.io/metro/docs/en/configuration
*
* eslint-env node, es6
*/
const exclusionList = require('metro-config/src/defaults/exclusionList');
const getWorkspaces = require('get-yarn-workspaces');
const path = require('path');
@krisleech
krisleech / renew-gpgkey.md
Last active April 22, 2024 20:13
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@colophonemes
colophonemes / create_triggers
Last active February 17, 2024 15:15
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@joshdover
joshdover / ExtendedRichUtils.js
Last active July 30, 2021 12:58
Example of how to add metadata to blocks for handling text alignment correctly
import { Modifier, EditorState, RichUtils } from 'draft-js';
import getCurrentlySelectedBlock from './getCurrentlySelectedBlock';
export const ALIGNMENTS = {
CENTER: 'center',
JUSTIFY: 'justify',
LEFT: 'left',
RIGHT: 'right'
};
@zmwangx
zmwangx / No longer able to make public gists secret.md
Last active April 11, 2024 22:22
No longer able to make public gists private — message to GitHub

We've been able to toggle visibility of gists since 2014 (https://github.com/blog/1837-change-the-visibility-of-your-gists), but I just noticed that I can no longer make public gists private. That is, when I edit private gists I still see the "Make Public" button, but not the other way round — there's only a "Delete" button when I edit public gists; the "Make Secret" which should be next to it (as shown in the screencast in the linked blog post) is nowhere to be found. I made a screenshot and a screencast demonstrating the issue, both of which are attached. Could you please confirm this issue? Was this an intentional change, and why? Thank you for your attention.

gist-unable-to-make-secret

![gist-unable-to-make-secret](https://cloud.githubusercontent.com/assets/4149852/16898407/c76db210-4c0b-11e6-9108-0450f1edebb4.gif)
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active March 20, 2024 08:12
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"