Skip to content

Instantly share code, notes, and snippets.

View bootstrap_start_template.html
<!DOCTYPE html>
<html lang="en">
<!-- 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="" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
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
<!DOCTYPE html>
<html lang="en">
<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 -->
easonhan007 / 1) Install
Created Nov 26, 2015 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
View 1) Install
// --- Compiling ---
$ wget
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh
$ rpm -Uvh
easonhan007 /
Last active Dec 12, 2019
python selenium expected_conditions examples
# example of how to use
from selenium import webdriver
from import expected_conditions as EC
from import WebDriverWait
from import By
import unittest
View rspec_model_testing_template.rb
# 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:
easonhan007 / multi_mina.rb
Created Mar 17, 2015
View multi_mina.rb
def load_config(server)
thirdpillar_config =YAML.load('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']
server = ENV['MINA_ENV'] || 'staging'
easonhan007 / stock_config.rb
Created Dec 15, 2014
View stock_config.rb
class StockConfig
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
include Virtus.model
attribute :money, Integer
attribute :month, Integer
attribute :policy_id, Integer
#coding: utf-8
import unittest
from selenium import webdriver
import time
class LoginCase(unittest.TestCase):
def setUp(self): #每个用例执行之前执行
print 'before test'
easonhan007 / insert_sort.c
Created Sep 5, 2014
how to implement insert sort using c
View insert_sort.c
#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) {