View bootstrap_start_template.html
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"> | |
</head> |
View string_test_case.py
This file contains 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 unittest | |
class StringTestCase(unittest.TestCase): | |
def setUp(self): | |
self.test_string = "This is a string" | |
def testReverse(self): | |
self.assertEqual("gnirts a si sihT", self.test_string[::-1]) |
View bootstrap_blank_template_v3.3.7.html
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Bootstrap 101 Template</title> | |
<!-- Bootstrap --> |
View 1) Install
This file contains 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
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
View expected_conditions_example.py
This file contains 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
#encoding:utf-8 | |
# example of how to use https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/support/expected_conditions.py | |
from selenium import webdriver | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.support.wait import WebDriverWait | |
from selenium.webdriver.common.by import By | |
import unittest |
View rspec_model_testing_template.rb
This file contains 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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
View multi_mina.rb
This file contains 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
def load_config(server) | |
thirdpillar_config =YAML.load(File.open('config/mina.yml')) | |
puts "———-> configuring #{server} server" | |
set :domain, thirdpillar_config[server]['domain'] #retriving the domain value for current server | |
set :deploy_to, thirdpillar_config[server]['deploy_to'] #retriving the deploy_to value for current server | |
set :repository, thirdpillar_config[server]['repository'] | |
set :branch, thirdpillar_config[server]['branch'] | |
end | |
server = ENV['MINA_ENV'] || 'staging' |
View stock_config.rb
This file contains 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 StockConfig | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
include Virtus.model | |
attribute :money, Integer | |
attribute :month, Integer | |
attribute :policy_id, Integer |
View pyunit_start_point.py
This file contains 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
#coding: utf-8 | |
import unittest | |
from selenium import webdriver | |
import time | |
class LoginCase(unittest.TestCase): | |
def setUp(self): #每个用例执行之前执行 | |
print 'before test' |
View insert_sort.c
This file contains 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
#include <stdio.h> | |
int main() { | |
int arr[] = {1, 8, 9, 4, 8, 7, 2, 3, 4, 90, 34}; | |
int len = sizeof(arr) / sizeof(arr[0]); | |
int i; | |
for(i = 1; i < len - 1; i++) { | |
int key = arr[i]; | |
int j = i - 1; | |
while(arr[j] > key && j >=0) { |
NewerOlder