Skip to content

Instantly share code, notes, and snippets.

@naosim
naosim / phaser_group.js
Created August 15, 2015 02:07
PhaserでGroupを使う
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'phaser-area');
var player;
var coinGroup;
var cursors;
var playerSpeed = 3;
game.state.add('main', {
preload: function() {
game.stage.backgroundColor = '#ffffdd';
game.load.image('player', '../../common/img/buta2.png');
game.load.image('coin', '../../common/img/coin.png');
CREATE OR REPLACE FUNCTION base36_decode(IN base36 varchar)
RETURNS bigint AS $$
DECLARE
a char[];
ret bigint;
i int;
val int;
chars varchar;
BEGIN
chars := '0123456789abcdefghijklmnopqrstuvwxyz';
@OnniSaarni
OnniSaarni / fikaserver.md
Last active May 9, 2024 04:36
SPT AKI Fika Server With Docker Ubuntu/Debian
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 9, 2024 04:36
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
import * as React from 'react';
import { DateTime } from 'luxon';
import { Calendar as CalendarIcon } from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Calendar } from '@/components/ui/Calendar';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover';
import { cn } from '@/lib/utils';
import { SelectSingleEventHandler } from 'react-day-picker';
import { Label } from '@/components/ui/Label';
@messeb
messeb / URLResponse+HTTP.swift
Created December 5, 2017 21:00
URLResponse as HTTPURLResponse and check if call has status code 2xx
extension URLResponse {
/// Returns casted `HTTPURLResponse`
var http: HTTPURLResponse? {
return self as? HTTPURLResponse
}
}
extension HTTPURLResponse {
/// Returns `true` if `statusCode` is in range 200...299.
/// Otherwise `false`.
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 9, 2024 04:32
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 04:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@soichisumi
soichisumi / firestore-listen-query.go
Created December 4, 2018 18:47
example of listening firestore realtime update in golang
package main
import (
"firebase.google.com/go"
"cloud.google.com/go/firestore"
"context"
"log"
"fmt"
)