Skip to content

Instantly share code, notes, and snippets.

View dplord's full-sized avatar

Deng Pan dplord

View GitHub Profile
@dplord
dplord / oneMillionPrime.c
Last active August 29, 2015 14:19
oneMillionPrime.c
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#define MAX 1000000000
int main()
{
@dplord
dplord / tenMillionFile.rs
Created April 23, 2015 07:47
tenMillionFile.rs
use std::rand;
use std::rand::Rng;
use std::old_io::BufferedReader;
use std::old_io::File;
fn write_file(path: &str, s: &str)
{
use std::old_io::{BufferedWriter, File};
var Base64 = (function(obj) {
// private property
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// public method for encoding
obj.encode = function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
function find_git_branch {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head == ref:\ refs/heads/* ]]; then
git_branch=" ${head#*/*/}"
elif [[ $head != '' ]]; then
git_branch=' (detached)'
else
#论坛
127.0.0.1 www.hupu.com
127.0.0.1 bbs.hupu.com
#social社交
127.0.0.1 www.qzone.qq.com
127.0.0.1 qzone.qq.com
127.0.0.1 wx.qq.com
127.0.0.1 weibo.com
#!/bin/bash
cd /home/dengpan/
nowTime=`date "+%Y%m%d_%H%m"`
tar Jcvf www_$nowTime.tar.xz www/
dir=dplord_com_whole_$nowTime
mkdir /home/dengpan/backup/$dir
mv www_$nowTime.tar.xz /home/dengpan/backup/$dir
cd /home/dengpan/backup/$dir
curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" -k "http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.tar.gz"
<?php
/**
* Created by PhpStorm.
* User: dengpan
* Date: 16/4/21
* Time: 12:31
*/
// create by dplord at ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}
#[[#include]]# <iostream>
#[[#include]]# <string>
#[[#include]]# <vector>
#[[#include]]# <fstream>
#[[#include]]# <sstream>
#[[#include]]# <boost/lexical_cast.hpp>
#[[#include]]# <map>
#[[#include]]# <unordered_map>
// create by dplord at ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}
#[[#include]]# <stdio.h>
#[[#include]]# <string.h>
int main(int argc, char** arrv)
{
return 0;
}