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
| setStateSynchronous(stateUpdate) { | |
| return new Promise(resolve => { | |
| this.setState(stateUpdate, () => resolve()); | |
| }); | |
| } | |
| // https://stackoverflow.com/questions/42018342/is-there-a-synchronous-alternative-of-setstate-in-reactjs |
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
| const { computed, reactive } = vueCompositionApi | |
| var UploadFile = new Vue({ | |
| name: 'UploadFile', | |
| delimiters: ['[[', ']]'], | |
| setup (initProps, setupContext) { | |
| const refs = setupContext.refs | |
| const maxSizeMB = (FILE_UPLOAD_MAX_MEMORY_SIZE / 1024 / 1024).toFixed(0) |
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
| {"lastUpload":"2019-08-14T02:40:29.164Z","extensionVersion":"v3.4.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
| defmodule Mix.Tasks.MyTask do | |
| use Mix.Task | |
| import Ecto.Query | |
| alias MyApp.Repo | |
| @start_apps [ | |
| :postgrex, | |
| :ecto, | |
| :ecto_sql | |
| ] |
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
| [default] | |
| DB_NAME=mydb | |
| DB_PASSWORD=mypass | |
| DB_USERNAME=myuser |
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
| - name: Upload SVN repos data | |
| become: "{{ svn_user }}" | |
| command: "gunzip -c {{ svn_dumps_dir }}/{{ item.item }}.tgz | svnadmin load {{ svn_data_dir }}/{{ item.item }} 1>/dev/null 2>/dev/null" | |
| loop: "{{ stats.results }}" | |
| when: item['stat']['exists'] | |
| # No such file or directory", "gzip: svnadmin.gz: ??? |
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
| --- | |
| - name: Reset SVN repos | |
| hosts: controller | |
| become: yes | |
| become_user: root | |
| remote_user: "{{ remote_user }}" | |
| vars_files: | |
| - ../../group_vars/uat/main.yaml |
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 django.db import connection | |
| def categories(): | |
| sql = ''' | |
| SELECT | |
| SUM(pageview) AS pageview__sum, | |
| substring(url from '^/[^/]+/') AS category | |
| FROM portal_tracker | |
| GROUP BY substring(url from '^/[^/]+/') | |
| HAVING substring(url from '^/[^/]+/') IS NOT NULL |
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
| class Tracker(models.Model): | |
| url: str = models.CharField(max_length=255, null=False) | |
| date: datetime.date = models.DateField(auto_now_add=True) | |
| pageview: int = models.BigIntegerField(default=0) | |
| deleted: bool = models.BooleanField(default=False) | |
| class Meta: | |
| unique_together = ("url", "date") |
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
| SELECT SUM(pageview) AS pageview__sum, substring(url from '^/[^/]+/') AS category | |
| FROM portal_tracker | |
| GROUP BY substring(url from '^/[^/]+/') | |
| HAVING substring(url from '^/[^/]+/') IS NOT NULL | |
| ORDER BY pageview__sum DESC; |