Skip to content

Instantly share code, notes, and snippets.

@mjohnsullivan
mjohnsullivan / particles.dart
Last active September 13, 2023 04:52
Demonstrates drawing and animating simple shapes in Flutter
// Adapted from https://github.com/nhancv/nc_flutter_util
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
main() {
runApp(new MaterialApp(
@Ryonez
Ryonez / (Unofficial) Discord server rules suggestions list.md
Last active April 25, 2024 12:53
(Unofficial) Discord server rules suggestions list

Discord

(Unofficial) Discord server rules suggestions list

Author's Note

I'll start off with letting you know this is a fork from someone else. However, for some bizarre reason, this is the one everyone finds, so I better get round to updating this. Credit to Cristiano#2233 for the original idea.

Also, I've had a lot of people saying the rules are to strict. If you pick all the rules here, you're right, it would be very strict. However the rules below are guidelines! They are there for you to pick the ones you desire, you can ignore ones you don't want. Hopefully they might help with rules you wouldn't have thought of otherwise.

@jagrosh
jagrosh / Growing A Discord Server.md
Last active February 17, 2024 04:29
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@kiennt
kiennt / model_user.ex
Created December 20, 2016 03:54
Absinthe authorization example
defimpl Kipatest.Can, for: Kipatest.User do
use Kipatest.Web, :model
def can?(%User{} = subject, :owner, %User{} = user) do
user.id == subject.id
end
end
defmodule Kipatest.AccessToken do
use Kipatest.Web, :model
@type t :: %{__struct__: atom}
@primary_key {:id, Ecto.UUID, autogenerate: true}
schema "access_tokens" do
field :is_valid, :boolean, default: true
field :refresh_token, Ecto.UUID, autogenerate: true
field :expired_at, Timex.Ecto.DateTime
using UnityEditor;
using UnityEngine;
/// <summary>
/// Made by Rodrigo Diaz
/// http://www.rodrigos.work
/// This code is licensed under MIT license
///
/// Make sure to add this class under a folder named "Editor" in the Unity Project
///
@guillaumewuip
guillaumewuip / gitlab_ci.yml
Created June 26, 2016 16:49
Gitlab CI to dokku
###############################################################################
# Variables #
###############################################################################
variables:
DOKKU_HOST: 'host.com'
PROJECT_NAME: 'project_name'
###############################################################################
# Cache #
###############################################################################
function timestampAction(action) {
return {
action,
time: Date.now()
}
}
function storageMiddleware() {
return () => next => action {
const stampedAction = timestampAction(action);

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@shangoyanyi
shangoyanyi / spotify-oauth-in-react.js
Last active June 16, 2017 17:31
React - do spotify oauth with React
var React = require("react");
module.exports = React.createClass({
...,
// open new spotify oauth window
handleLoginRequest: function(){
var url = 'https://accounts.spotify.com/authorize' +
'?client_id=' + this.props.clientId +
'&redirect_uri=' + encodeURIComponent(this.props.redirectUri) +
'&scope=' + encodeURIComponent(this.props.scope) +