Skip to content

Instantly share code, notes, and snippets.

View rzvdaniel's full-sized avatar

Razvan Predescu rzvdaniel

View GitHub Profile
@NadOby
NadOby / svelte_vim.md
Last active March 12, 2023 18:37
Howto configure Svelte 3 Editing under NeoVim

SvelteJS from absolute zero to editing it in (Neo)Vim

Assuming that we don't have nothing related to JavaScript installed or configured.

Based on https://www.rockyourcode.com/vim-and-svelte-js

Installation of Node.js using NVM

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
nvm install node
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@singledigit
singledigit / cognito.yaml
Last active January 16, 2024 16:15
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@tdd
tdd / GitHub with Operator Mono font for code.md
Created April 24, 2017 15:20
Use Operator Mono Ssm font in GitHub code views (PRs, diffs, etc.)

So you love the Operator Mono font? I don't blame you! So do we! It's a bit pricey but worth every penny.

In fact, we're so used to it in our editors that we were a bit sad with GitHub's otherwise neat code views. When we review PRs in the web UI, we want our Operator Mono!

So, assuming you have it installed on your machine, you can put the JS bit in the other code snippet of this Gist in a bookmarklet, and click it when you're on a GitHub.com page you want to have switch over to our beloved font. We used the ScreenSmart variant here, which you get in the font package and have probably installed, as it's the more legible one on screens. Feel free to adjust the font name if needed.

@hfalucas
hfalucas / [1] main.js
Last active March 13, 2024 05:49
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@jordandee
jordandee / sdl2_opengl.cpp
Last active April 14, 2024 05:16
Simple SDL2/OpenGL example
// To compile with gcc: (tested on Ubuntu 14.04 64bit):
// g++ sdl2_opengl.cpp -lSDL2 -lGL
// To compile with msvc: (tested on Windows 7 64bit)
// cl sdl2_opengl.cpp /I C:\sdl2path\include /link C:\path\SDL2.lib C:\path\SDL2main.lib /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libcmtd.lib opengl32.lib
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@GrantByrne
GrantByrne / UserValidator.cs
Created April 24, 2014 06:02
Using Fluent Validation with WPF - Dead Simple
using System.Text.RegularExpressions;
using FluentValidation;
using WpfFluentValidationExample.ViewModels;
namespace WpfFluentValidationExample.Lib
{
public class UserValidator : AbstractValidator<UserViewModel>
{
public UserValidator()
{
@mahdi
mahdi / .gitignore
Created August 2, 2011 08:10
A .gitignore file for a .NET developer
#Junk Files
*.DS_Store
[Tt]humbs.db
#Visual Studio Files
[Oo]bj
[Bb]in
[Dd]ebug
[Bb]uild/
*.user
@paigecook
paigecook / .gitignore
Created June 14, 2011 11:42
Git Ignore Settings
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #