Skip to content

Instantly share code, notes, and snippets.

View nienkedekker's full-sized avatar
❄️

Nienke Dekker nienkedekker

❄️
View GitHub Profile
[
{
"name":"/changelog/001-2020-07-17",
"content":"import { Text } from '@daily/shared/components/Text';\nimport { Callout } from 'components/Callout';\nimport { MainLayout } from 'components/Layout';\nimport { SuggestedPosts } from 'components/SuggestedPosts';\nimport { getPostBySlug } from 'lib/blog';\nimport { REVALIDATE } from 'lib/constants';\n\nexport const meta = {\n title: 'Changelog #001 - 2020-07-17',\n description:\n 'The latest engineering updates from the Daily real-time video and audio API team.',\n metaImage: '/assets/changelog-01.gif',\n createdAt: '2020-07-17',\n updatedAt: '2021-07-13',\n};\n\nexport const postSlugs = [\n 'record-video-calls-automatically-with-the-daily-co-api',\n 'an-introduction-to-live-streaming-with-daily-co',\n];\n\n# July 17, 2020\n\n<small>Changelog #001</small>\n\n<Callout variant=\"success\">\n <Text variant=\"strong\">Welcome to our first changelog!</Text>\n <Text>\n These will be weekly posts to highlight all the work we're doing here
[
{
"name":"/changelog/001-2020-07-17",
"content":"import { Text } from '@daily/shared/components/Text';\nimport { Callout } from 'components/Callout';\nimport { MainLayout } from 'components/Layout';\nimport { SuggestedPosts } from 'components/SuggestedPosts';\nimport { getPostBySlug } from 'lib/blog';\nimport { REVALIDATE } from 'lib/constants';\n\nexport const meta = {\n title: 'Changelog #001 - 2020-07-17',\n description:\n 'The latest engineering updates from the Daily real-time video and audio API team.',\n metaImage: '/assets/changelog-01.gif',\n createdAt: '2020-07-17',\n updatedAt: '2021-07-13',\n};\n\nexport const postSlugs = [\n 'record-video-calls-automatically-with-the-daily-co-api',\n 'an-introduction-to-live-streaming-with-daily-co',\n];\n\n# July 17, 2020\n\n<small>Changelog #001</small>\n\n<Callout variant=\"success\">\n <Text variant=\"strong\">Welcome to our first changelog!</Text>\n <Text>\n These will be weekly posts to highlight all the work we're doing here
@nienkedekker
nienkedekker / IsPlainObject.decorator.ts
Created March 27, 2019 08:48
Custom TypeScript decorator for plain objects
import {registerDecorator, ValidationOptions, ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments} from 'class-validator';
@ValidatorConstraint({ async: true })
export class ValidateObject implements ValidatorConstraintInterface {
validate(data: object, args: ValidationArguments) {
return data.constructor === Object;
}
}
export default function IsPlainObject(validationOptions?: ValidationOptions) {
@nienkedekker
nienkedekker / phpstorm-cs-fixer.md
Last active February 2, 2024 03:09
Set up PHP-CS-Fixer in PHPStorm

Use PHP-CS-Fixer in PHPStorm

  • Install PHP-CS-Fixer on your local machine according to these instructions: https://github.com/FriendsOfPHP/PHP-CS-Fixer
  • Open PHPStorm, Preferences > Tools > External Tools and enter these values: img
  • Program, edit to match your path where PHP-CS-Fixer lives: /.composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
  • Parameters: --rules=@PSR2 --verbose fix $FileDir$/$FileName$. Note that previous verions of PHP-CS-Fixer used --levels instead of --rules.
  • Working directory: $ProjectFileDir$

Click OK and Apply. Now we'll set up a shortcut.

  • Go to Preferences > Keymap and search for "PHP Fixer" (or whatever name you gave it). Add whatever shortcut you like, I'm using ctrl + cmd + ]:
# Found this on StackOverflow and it allows the use of colors within the Terminal (OSX, should work on Windows as well).
class String
def black; "\033[30m#{self}\033[0m" end
def red; "\033[31m#{self}\033[0m" end
def green; "\033[32m#{self}\033[0m" end
def brown; "\033[33m#{self}\033[0m" end
def blue; "\033[34m#{self}\033[0m" end
def magenta; "\033[35m#{self}\033[0m" end
def cyan; "\033[36m#{self}\033[0m" end
def gray; "\033[37m#{self}\033[0m" end
questions_answered = 0
def wait_for_question(questions_answered)
if questions_answered == 0
puts "What is your question, human?"
else
puts "Do you have another question, human?"
end

Keybase proof

I hereby claim:

  • I am nienkedekker on github.
  • I am nienkedekker (https://keybase.io/nienkedekker) on keybase.
  • I have a public key whose fingerprint is DA70 34A4 1C6A F9AB DFE1 E1B5 7FCE 8517 127C 8500

To claim this, I am signing this object:

@nienkedekker
nienkedekker / .bash_profile
Last active August 5, 2016 07:57
Bash_profile
# -----------------------------
# TERMINAL PROMPT
# -----------------------------
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h 🗂 \[\033[33;1m\]\w\[\033[m\] ⚡ \$(__git_ps1) \$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# -----------------------------
# ALIASING
# -----------------------------