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 | |
# encoding: utf-8 | |
# Author: qingfeng@douban.com | |
from __future__ import with_statement | |
from optparse import OptionParser | |
import os | |
parser = OptionParser(version="new9 command v1.0 -- by qingfeng@douban.com") | |
parser.add_option("-p", "--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
package main | |
import ( | |
"fmt" | |
"time" | |
"math/rand" | |
) | |
const ( | |
CUTTING_TIME = 20 |
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 <tunables/global> | |
/usr/bin/skype { | |
#include <abstractions/base> | |
#include <abstractions/user-tmp> | |
#include <abstractions/audio> | |
#include <abstractions/nameservice> | |
#include <abstractions/ssl_certs> | |
#include <abstractions/fonts> | |
#include <abstractions/ibus> | |
#include <abstractions/dbus> |
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
$ gcc main.c -lkeyutils && ./a.out | |
15904 1 | |
15904 0 | |
15904 0 | |
15904 0 | |
15905 1 | |
15906 1 | |
15905 0 | |
15906 0 | |
15907 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
#!/bin/bash | |
number=$1 | |
method=$2 | |
ss-tunnel -k test -m $method -l 8387 -L 127.0.0.1:8388 -s 127.0.0.1 -p 8389 & | |
ss_tunnel_pid=$! | |
ss-server -k test -m $method -s 127.0.0.1 -p 8389 & | |
ss_server_pid=$! |
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
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS add_email_address_column_to_customers_table $$ | |
-- Create the stored procedure to perform the migration | |
CREATE PROCEDURE add_email_address_column_to_customers_table() | |
BEGIN | |
-- Add the email_address column to the customers table, if it doesn't already exist |
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
# D-I config version 2.0 | |
default debian/7.4/amd64/boot-screens/vesamenu.c32 | |
prompt 1 | |
timeout 300 | |
menu title - Boop Menu - | |
label Debian-7.4 | |
menu label ^0 Debian 7.4 | |
#include debian/7.4/amd64/boot-screens/menu.cfg | |
kernel debian/7.4/amd64/linux |
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
-module(barber). | |
-export([run/2, barber/1, clients/1, simulator/2]). | |
-define(CUT_DUTAION, 20). | |
run(RoomSize, Duration) -> | |
% create barber | |
BPid = spawn(?MODULE, barber, [?CUT_DUTAION]), | |
% run simulartor with barber PID | |
SPid = spawn(?MODULE, simulator, [BPid, RoomSize]), |
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 BaseHTTPServer | |
import SimpleHTTPServer | |
import socket | |
class HTTPServer6(BaseHTTPServer.HTTPServer): | |
address_family = socket.AF_INET6 | |
if __name__ == '__main__': |
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
const functions = require('firebase-functions'); | |
const TelegramBot = require('node-telegram-bot-api'); | |
const token = "***" | |
const chatID = 1024 // your telegram id, you must first send a message to your bot | |
exports.notifyIAP = functions.analytics.event('in_app_purchase').onLog((event) => { | |
const purchaseValue = event.valueInUSD; | |
if (purchaseValue > 0) { | |
const bot = new TelegramBot(token, {polling: false}); |
OlderNewer