Some fake data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import strutils as str | |
import math except sin | |
# Helpers | |
proc newline(text: string): string = | |
text & "\r\n" | |
proc colorize(text: string, color: int, isBright: bool): string = | |
let |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
import re | |
import pdb | |
import sys | |
filename = path.join( | |
path.dirname(__file__), 'semaine_depenses.txt' | |
) | |
with open(filename, 'r') as file: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the default exported object from some modules | |
import React from 'react'; | |
import Actions from './Actions.jsx'; | |
import ProgressBar from './ProgressBar.jsx'; | |
// Load all fns exported in a module | |
import * as api from './api'; | |
// Load some fns exported in a module | |
import {decodeParams, pad} from './utils'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro --> | |
[x & forms] | |
(let [next (fn [x] (let [r (rest x)] (if (empty? r) nil r)))] | |
(loop [x x, forms forms] | |
(if forms | |
(let [form (first forms) | |
threaded (if (list? form) | |
(with-meta | |
`(~(first form) ~@(next form) ~x) | |
(meta form)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) { | |
Meteor.publish('documents', function() { | |
return Documents.find({}); | |
}); | |
Meteor.startup(function() { | |
var doc = Documents.findOne({title: 'Initial document'}); | |
if (!doc) { | |
Documents.insert({ | |
title 'Initial document', |
Install Meteor
Follow instructions.
# Create a new meteor project
meteor create <appName>
cd <appName>
# Delete default files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'mmm-mode) | |
(mmm-add-classes | |
'((jsx | |
:submode web-mode | |
:front "\\((\\)[[:space:]\n]*<" | |
:front-match 1 | |
:back ">[[:space:]\n]*\\()\\)" | |
:back-match 1))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var watchify = require('watchify'); | |
var browserify = require('browserify'); | |
var factor = require('factor-bundle'); | |
var bundleLogger = require('../util/bundleLogger'); | |
var handleErrors = require('../util/handleErrors'); | |
var gulp = require('gulp'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('browserify', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Example: | |
;; (part-cons '(1 2 3 4 5)) ;; => '((1 . 2) (3 . 4) (5)) | |
(define (part-cons l [acc '()]) | |
(if (equal? l null) | |
acc | |
(let ([k (car l)] | |
[v (if (null? (cdr l)) null (cadr l))] | |
[ll (if (> (length l) 1) | |
(drop l 2) |