Skip to content

Instantly share code, notes, and snippets.

View jesperp's full-sized avatar
📚
Studying from home

Jesper jesperp

📚
Studying from home
View GitHub Profile
" ---------[ Vim Plugz ]---------
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'sheerun/vim-polyglot'
Plug 'mattn/emmet-vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'sainnhe/sonokai'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'coc-extensions/coc-svelte', {'do': 'yarn install --frozen-lockfile'}
@jesperp
jesperp / machine.js
Last active February 19, 2020 17:48
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@jesperp
jesperp / machine.js
Created February 5, 2020 14:38
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
-module(bracketpush).
-export([check_brackets/1]).
check_brackets(Str) ->
check_brackets(Str, []).
% Base cases
check_brackets([], []) -> true;
import Html
import Html.App
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Navigation exposing (Location)
import RouteUrl
import RouteUrl exposing (UrlChange, HistoryEntry(NewEntry))
import String
import Html
import Html.App
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
type alias Model = Int
type Msg = Increment | Decrement | Reset | Set Int
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
import AnimationFrame
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Style
import Style.Properties exposing (..)
import Time exposing (Time)
@jesperp
jesperp / officehours.py
Created April 4, 2016 21:05
Generate office hours
import itertools
from datetime import time, timedelta, datetime
OFFICE_OPEN = time(8, 0, 0)
OFFICE_CLOSE = time(16, 0, 0)
def isofficehour(dt):
t = dt.time()
if dt.weekday() in (5,6): # Weekend
@jesperp
jesperp / modulename.cpp
Created May 13, 2012 18:34
GraphicsMagick in node binding freezes
#include <node.h>
#include <Magick++.h>
#include <iostream>
#include <string>
using namespace v8;
Handle<Value> Async(const Arguments& args);
void AsyncWork(uv_work_t* req);
@jesperp
jesperp / gist:980369
Created May 19, 2011 07:54 — forked from sorl/gist:979651
Upp! API version 1
#coding=utf-8
__test__ = {
"api_v1": """
Upp! API version 1
==================
Testing the functionality of Upp! API
>>> from django.utils import simplejson as json
>>> from django.test.client import Client