Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonas Galvez galvez

View GitHub Profile
View white-rose.py
#!/usr/bin/python
from time import sleep
from pygame import mixer
mixer.init()
# Download file from https://freesound.org/people/Koyber/sounds/160483/
mixer.music.load('white-rose.mp3')
mixer.music.play()
View nuxt.config.js
module.exports = {
build: {
loaders: [
{
test: /\.(png|jpe?g|gif|svg)$/,
loader: 'url-loader',
query: {
limit: 1000, // 1KO
name: 'img/[name].[hash:7].[ext]'
}
View index.vue
<template>
<div>
<h1>Hello world</h1>
</div>
</template>
View networHelper.js
import fetch from 'isomorphic-fetch'
import { ENV } from 'constants/env'
export const URL = (path, host, schema = 'http') => {
return `${schema}://${host}/${path}/`
}
export const GET = 'GET'
export const DELETE = 'DELETE'
export const HEAD = 'HEAD'
View snakeworm.html
<style>
.cobra {
position: absolute;
top: 100px;
left: 100px;
width: 200px;
height: 20px;
background: #ccc;
border-radius: 10px;
}
View validation.py
import json
import re
import code
import pprint
from marshmallow import Schema
from marshmallow.schema import Schema
from marshmallow.fields import Str, Bool, Int, List, Nested, DateTime, URL
from werkzeug.routing import Map, Rule, NotFound, RequestRedirect
BASE = os.path.abspath(os.path.dirname(__file__))
View TS-Deep-Dive-Notes.md

Declare

$('.awesome').show(); // Error: cannot find name `$`

declare var $:any;
$('.awesome').show(); // Okay!

declare var $:{
View grouping.py
import csv
import itertools
def match(file, fields):
records = {}
parsed = list(csv.reader(open(file, 'rU')))
columns = parsed[0]
indexes = {}
index_fields = list(itertools.chain(*[
f for f in fields if type(f) == list
View grouping.py
import csv
import itertools
def match(file, fields):
records = {}
parsed = list(csv.reader(open(file, 'rU')))
columns = parsed[0]
indexes = {}
index_fields = list(itertools.chain(*[
f for f in fields if type(f) == list
View Budget.txt
+ 3000 Salary
- 100 Expense
- 200 Expense
- 50 Expense
= Group
- 100 Expense
- 200 Expense
You can’t perform that action at this time.