Skip to content

Instantly share code, notes, and snippets.

View marsen's full-sized avatar
🕯️
Freedom

Marsen marsen

🕯️
Freedom
View GitHub Profile
context('# [修改使用者權限] for normal admin', () => {
before(() => {
// 製作假資料
// 本 context 會用這筆資料進行測試
this.UserMock = createModelMock('User', {
id: 1,
email: 'not_root@example.com',
name: 'admin',
isAdmin: true, // 是管理者
})
@marsen
marsen / add_action.ts
Last active October 3, 2021 16:50
i18n side effect solution
export const changingLanguageAction =
(language:'en'|'zh'): ThunkAction<
void,
LanguageState,
unknown,
LanguageActionTypes
> =>
async (dispatch,getState) => {
i18n.changeLanguage(language);
dispatch(changeLanguageAction(language));
--- Actions ---
$Copy <C-C> <C-Ins>
$Cut <C-X> <S-Del>
$Delete <Del>
$LRU
$Paste <C-V> <S-Ins>
$Redo <C-S-Z> <A-S-BS>
$SearchWeb
$SelectAll <C-A>
$Undo <C-Z> <A-BS>
@marsen
marsen / 91app_timberland_ecoupon.js
Created August 29, 2020 05:46
純靠北工程師 5087
/* 91APP Inc.遊戲產生器91APP All rights reserved. */
$(function(){
var url = window.location.href;
var share_fb = 'http://www.facebook.com/sharer.php';
$('.share_fb').attr('href',share_fb+'?u='+url);
var share_line = 'http://line.naver.jp/R/msg/text/';
$('.share_line').attr('href',share_line+'?'+url);
});
$(function(){
@marsen
marsen / actionlist.vim
Last active March 6, 2020 04:40 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
[
{
"ISO": "AD",
"Country": "Andorra",
"Continent": "EU"
},
{
"ISO": "AE",
"Country": "United Arab Emirates",
"Continent": "AS"
[
{
"ISO": "AD",
"Country": "Andorra",
"Continent": "EU"
},
{
"ISO": "AE",
"Country": "United Arab Emirates",
"Continent": "AS"
@marsen
marsen / custom.css
Last active December 13, 2018 11:07
/*
Copyright 2017 Bryan Keller (https://github.com/widget-)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@marsen
marsen / ctor.snippet
Last active April 23, 2018 03:28
C# snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ctor</Title>
<Shortcut>ctor</Shortcut>
<Description>建構函式的程式碼片段</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@marsen
marsen / Big_Dropdownlist
Created July 21, 2016 09:53
Tampermonkey - 讓bitbucket開PR的時候完整顯示Branche資訊
// ==UserScript==
// @name Big Dropdownlist
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Marsen
// @match https://bitbucket.org/*/*/pull-requests/new
// @grant none
// ==/UserScript==