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 os | |
| import numpy as np | |
| import platform | |
| import subprocess | |
| import wave | |
| import torch | |
| from ChatTTS import Chat | |
| import argparse | |
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
| #!/bin/bash | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### | |
| ### to verify your gpu is cuda enable check |
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
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /Users/YOUR_USERNAME/Sites; | |
| access_log /Library/Logs/default.access.log main; | |
| location / { | |
| include /usr/local/etc/nginx/conf.d/php-fpm; | |
| } |
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
| /** | |
| * Filters an array of objects using custom predicates. | |
| * | |
| * @param {Array} array: the array to filter | |
| * @param {Object} filters: an object with the filter criteria | |
| * @return {Array} | |
| */ | |
| function filterArray(array, filters) { | |
| const filterKeys = Object.keys(filters); | |
| return array.filter(item => { |
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
| // guid-> 9b06304f-e10f-4363-8257-eca66e58e559 | |
| export default function guid() { | |
| let s = []; | |
| let hexDigits = '0123456789abcdef'; | |
| for (var i = 0; i < 36; i++) { | |
| s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); | |
| } | |
| s[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010 | |
| s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 | |
| s[8] = s[13] = s[18] = s[23] = '-'; |
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
| # first get the PPA repository driver | |
| sudo add-apt-repository ppa:graphics-drivers/ppa | |
| # install nvidai driver | |
| sudo apt install nvidia-384 nvidia-384-dev | |
| # install other import packages | |
| sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev | |
| # CUDA 9 requires gcc 6 |
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
| #用正则简单过滤html的<>标签 | |
| import re | |
| str = "<img /><a>srcd</a>hello</br><br/>" | |
| str = re.sub(r'</?\w+[^>]*>','',str) | |
| print str |
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 bash | |
| # https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
| # https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
| # http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
| # http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
| # http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
| # http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
| # Versions | |
| CHROME_DRIVER_VERSION=2.40 |
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
| echo "LC_ALL=en_US.UTF-8" >> /etc/environment | |
| echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen | |
| echo "LANG=en_US.UTF-8" > /etc/locale.conf | |
| locale-gen en_US.UTF-8 | |
| https://github.com/tianon/docker-brew-debian/issues/45 |
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
| Route::group(array('prefix' => 'api'), function() | |
| { | |
| Route::resource('cities', 'CitiesAPIController'); | |
| }); | |
| Route::filter('manage-city', function(){ | |
| if (! Entrust::can('edit-city') && $_SERVER['REQUEST_METHOD']!='GET') // Checks the current user | |
| { | |
| $API= new Twiddle\Http\Controllers\ApiController(); |
NewerOlder