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
<?php | |
function ajax_lookUpUsername(){ | |
$username = $this->input->post('username'); | |
$this->db->where('username', $username); | |
$query = $this->db->get('accounts'); | |
if ($query->num_rows() > 0){ | |
echo 0; | |
} else { | |
echo 1; | |
} |
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
-- -------------------------------------------------------------------------------- | |
-- Routine DDL | |
-- Note: comments before and after the routine body will not be stored by the server | |
-- -------------------------------------------------------------------------------- | |
DELIMITER $$ | |
CREATE DEFINER=`root`@`localhost` PROCEDURE `paginate`( | |
in _table varchar(100), | |
in _where varchar(100), | |
in _order_by varchar(100), |
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
#!/bin/bash | |
yum install -y ntp | |
ntpdate 0.centos.pool.ntp.org | |
sleep 3 | |
hwclock --systohc |
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
if ($request_uri ~ "\.htm") | |
{ | |
set $my_cond P; | |
} | |
if ($args){ | |
set $my_cond "${my_cond}C"; | |
} | |
if ($my_cond = PC) | |
{ | |
return 403; |
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
// origin: @ayanamist | |
// ==UserScript== | |
// @name Twitter Timeline URL Expand | |
// @namespace Twitter-Timeline-URL-Expand | |
// @description Replace t.co href of A tag with real url. | |
// @match http://twitter.com/* | |
// @match https://twitter.com/* | |
// @version 1.1 | |
// ==/UserScript== | |
(function (window) { |
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
" https://github.com/sontek/dotfiles/ | |
" ========================================================== | |
" Dependencies - Libraries/Applications outside of vim | |
" ========================================================== | |
" Pep8 - http://pypi.python.org/pypi/pep8 | |
" Pyflakes | |
" Ack | |
" nose, django-nose | |
" ========================================================== |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
File: xiami.py | |
Author: Luigi Fan | |
Description: Auto check-in script for xiami. | |
''' | |
import requests | |
import re |
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
require 'formula' | |
class Ydcv < Formula | |
homepage 'https://github.com/felixonmars/ydcv' | |
url 'https://github.com/felixonmars/ydcv/archive/master.zip' | |
version '0.0.1' | |
head 'https://github.com/felixonmars/ydcv' | |
def install | |
bin.install "src/ydcv.py" => "ydcv" |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
# Usage: chmod +x ./facebook_autorepoke.py; ./facebook_autorepoke.py email password | |
import requests | |
import sys | |
import re | |
from time import sleep | |
from pyquery import PyQuery as pq |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import requests | |
username = 'username' | |
password = 'password' | |
login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https### | |
index_url = 'http://v2ex.com' ###同上### | |
mission_url = 'http://www.v2ex.com/mission/daily' ###同上### |
OlderNewer