Add [[indexedsearch]] to mediagoblin.ini
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 bs4 import BeautifulSoup as bs | |
| import requests | |
| def stars_count(url): | |
| html = requests.get(url).text | |
| soup = bs(html, 'lxml') | |
| stars_class = "social-count js-social-count" | |
| stars = soup.find('a', class_=stars_class).text.strip() | |
| return stars |
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
| "use strict"; | |
| // module UnderscoreFFI | |
| exports.map = function(f) { | |
| return function (arr) { | |
| return require('underscore').map(arr, f); | |
| }; | |
| }; |
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
| #!/usr/bin/env nix-shell | |
| #!nix-shell -p "haskellPackages.ghcWithPackages (p: with p; [])" | |
| #!nix-shell -i "ghci" | |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE EmptyCase #-} | |
| {-# LANGUAGE FlexibleContexts #-} |
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 itertools import chain | |
| from functools import reduce | |
| import operator | |
| """ | |
| Usage of this module: | |
| <iterable> >> function3 * function2 * function1 >> aggregation | |
| for example: |
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
| <?php | |
| //api -> database | |
| require 'vendor/autoload.php'; | |
| $client = new GuzzleHttp\Client(); | |
| $res = $client->request( | |
| 'GET', | |
| 'http://chiebukuro.yahooapis.jp/Chiebukuro/V1/categoryTree', | |
| [ | |
| 'query'=>[ |
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
| ;; https://github.com/antirez/linenoise | |
| ;; console_codes(4) | |
| (defvar column-start "\e[0G") | |
| (defvar delete-to-end "\e[0K") | |
| (defvar retreat-cursor "\e[%sD") | |
| (defvar advance-cursor "\e[%sC") | |
| (defvar clear-screen "\e[H\e[2J") | |
| (defun read-byte () |
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
| (defun traffic-lights () | |
| (let ((state 'red)) | |
| (while t | |
| (cond | |
| ((eq state 'red) | |
| (message "Red") | |
| (sleep-for 1) | |
| (setq state 'red+yellow)) | |
| ((eq state 'red+yellow) | |
| (message "Red+Yellow") |
OlderNewer