One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
#!/bin/sh | |
# | |
# v2ray Startup script for v2ray | |
# | |
# chkconfig: - 24 76 | |
# processname: v2ray | |
# pidfile: /var/run/v2ray.pid | |
# description: V2Ray proxy services | |
# |
Mutex counter_mutex; | |
Condition read_phase, write_phase; | |
int resource_counter = 0; | |
// READERS | |
Lock(counter_mutex) { | |
while(resource_counter == -1) | |
Wait(counter_mutex, read_phase); | |
resource_counter++; | |
} // unlock |
let cat = document.querySelector("img"); | |
let angle = Math.PI / 2; | |
function animate(time, lastTime) { | |
if (lastTime != null) { | |
angle += (time - lastTime) * 0.001; | |
} | |
cat.style.top = (Math.sin(angle) * 20) + "px"; | |
cat.style.left = (Math.cos(angle) * 200) + "px"; | |
requestAnimationFrame(newTime => animate(newTime, time)); | |
} |
class Matrix { | |
constructor(width, height, element = (x, y) => undefined) { | |
this.width = width; | |
this.height = height; | |
this.content = []; | |
for(let y = 0; y < height; y++) { | |
for(let x = 0; x < width; x++) { | |
this.content[y * width + x] = element(x, y); | |
} | |
} |
function phi([n00, n01, n10, n11]) { | |
return (n11 * n00 - n10 * n01) / | |
Math.sqrt((n10 + n11) * | |
(n00 + n01) * | |
(n01 + n11) * | |
(n00 + n10)); | |
} |
for (let n = 1; n <= 100; n++) { | |
let output = ''; | |
if(n % 3 === 0) output += 'Fizz'; | |
if(n % 5 === 0) output += 'Buzz'; | |
console.log(output || n); | |
} |
package main | |
import "golang.org/x/tour/pic" | |
func Pic(fun func(x, y int) int) func(dx, dy int) [][]uint8 { | |
f := func(dx, dy int) [][]uint8 { | |
p := make([][]uint8, dy) | |
for i := 0; i < dy; i++ { | |
p[i] = make([]uint8, dx) | |
for j := 0; j < dx; j++ { |
package main | |
import ( | |
"fmt" | |
) | |
func Sqrt(x float64) float64 { | |
z := 1.0 | |
for i := 0; i < 10; i++ { | |
z -= (z*z - x) / (2 * z) |
// ==UserScript== | |
// @name Udacity Chinese courses video playback controller | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Enable forward/backward and play/pause for current mouse hovering video if more than one video tag on the page. | |
// @author organism <neuqzhj@gmail.com> | |
// @source https://gist.github.com/zhjgithub/38bff8b658af77b7c102a69e37b2f120 | |
// @match https://classroom.udacity.com/* | |
// @run-at document-end | |
// @grant none |