- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone [email protected]:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
| <?php | |
| /** | |
| * Implemets hook_preprocess_node(). | |
| * | |
| * Create variable from translated taxonomy term name. | |
| * Code by @tikaszvince. | |
| */ | |
| function THEMENAME_preprocess_node(&$variables) { | |
| /** @var Drupal\node\Entity\Node $node */ |
| import numpy as np | |
| import scipy as sp | |
| def jsd(p, q, base=np.e): | |
| ''' | |
| Implementation of pairwise `jsd` based on | |
| https://en.wikipedia.org/wiki/Jensen%E2%80%93Shannon_divergence | |
| ''' | |
| ## convert to np.array | |
| p, q = np.asarray(p), np.asarray(q) |
| #!/usr/bin/env python | |
| import pickle | |
| import sys | |
| if __name__ == '__main__': | |
| argv = sys.argv | |
| if len(argv) <= 1: | |
| print 'Specify pickle file as parameter.' |
| {# | |
| /** | |
| * @file | |
| * Get the current URL path via Drupal 8 route name and twig function. | |
| */ | |
| #} | |
| <a href="{{ url('<current>') }}">Current page</a> |
<hash> with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with httpsgit clone https://gist.github.com/.git mygist
This guide assumes you have the emmet and language-babel packages already installed in Atom
keymap.cson file by clicking on Atom -> Keymap… in the menu bar'atom-text-editor[data-grammar~="jsx"]:not([mini])':The Guardian offers an API as deep and robust as the New York Times Article API when it comes to content analysis.
The Guardian's API offers more than "1.7 million pieces of content", with published items as far back as 1999. You can register as a developer here, which gets you 5,000 API hits a day and an API key that looks something like this:
zzzyyyyy-9a9z-999z-z999-9e8a83922516
The Guardian has a handy interactive explorer to interactively tweak the query parameters.
| #!/usr/bin/env drush php-script --everything -v | |
| <?php | |
| // --------------------------------------- | |
| // CREDENTIALS ETC. | |
| // --------------------------------------- | |
| $dir = "public_html"; | |
| $theme_dir = "public_html/sites/all/themes"; | |
| $makefile = "site.make"; |
| /* Code is by A.J. Cates (http://ajcates.com). Find his post here: http://forr.st/~XGU */ | |
| #gradient-triangle { | |
| width: 60px; | |
| height: 60px; | |
| position: absolute; | |
| top: 3em; | |
| left: -30px; | |
| clip: rect(auto 30px 60px auto); | |
| } |