Skip to content

Instantly share code, notes, and snippets.

View yuikns's full-sized avatar

Yu yuikns

View GitHub Profile
@yuikns
yuikns / Makefile
Last active February 21, 2017 16:53
an example for makefile
CC := cc
CXX := c++
CP := @cp
MV := @mv
DEL := @rm -rf
LIBS := -ldl -lpthread -lm #-L lib/
INFLAGS := -I include/
@yuikns
yuikns / vsftpd.conf
Last active November 20, 2022 08:12
Example config file /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
@yuikns
yuikns / index.java
Last active December 23, 2016 20:53
package com.argcv.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
<?php
/**
*Plugin Name: SomeMoreSentence
*Version: 0.1
*Plugin URI: http://argcv.com
*Description: append some more sentence after the end of your post
*Author: Yu Jing
*Author URI: http://argcv.com/about
*/
JsonData = [
{
key: "Serie1",
values: [
{'Data1': 1,
'Data2': 2,
'Data3': 3,
'Data4': 4,
'Data5': 5
},
@yuikns
yuikns / assert_cuda.c
Created November 5, 2016 16:19 — forked from allanmac/assert_cuda.c
A tiny example of CUDA + OpenGL interop with write-only surfaces and CUDA kernels. Uses GLFW+GLAD.
//
//
//
#include <stdlib.h>
#include <stdio.h>
//
//
//
class Solution {
public:
//
int minOfNext(vector<int>& v1, vector<int>& v2, int n1, int n2, int o1, int o2) {
if(n1 > o1 && n2 > o2) {
return min(v1[o1],v2[o2]);
} else if(n1 > o1) {
return v1[o1];
} else {
return v2[o2];
@yuikns
yuikns / dict.py
Last active October 2, 2016 06:09
#!/usr/bin/python
# encoding: utf-8
import sys
import argparse
from workflow import Workflow
#from workflow import Workflow3
from DictionaryServices import *
import urllib2
@yuikns
yuikns / start-stop-daemon-template
Created September 25, 2016 23:21 — forked from bcap/start-stop-daemon-template
Template file for creating linux services out of executables using the start-stop-daemon
#!/bin/bash
### BEGIN INIT INFO
# Provides: <service name>
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: <service description>
### END INIT INFO
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > chnroute.txt