This file contains hidden or 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
<html> | |
<head> | |
<title>Clock :)</title> | |
</head> | |
<body> | |
<div id='clock_1'></div> | |
<div id='clock_2'></div> | |
</body> | |
</html> |
This file contains hidden or 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
#threads | |
import thread | |
import threading | |
import time | |
class ThreadTask(threading.Thread): | |
def __init__(self,name,delay,callback): | |
threading.Thread.__init__(self) | |
This file contains hidden or 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
upstream app_domain{ | |
server 127.0.0.1:4000; | |
} | |
server{ | |
listen 0.0.0.0:80; | |
server_name heracle.service.dev; | |
access_log /var/log/nginx/app_domain_access; |
This file contains hidden or 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
function mcd() | |
{ | |
var mcd = 1; | |
var tmpMcd = 1; | |
var values = [].slice.call(arguments); | |
values = values.sort(function(a,b){ return a - b; }); | |
var minVal = values[0]; | |
for(i=0;i<=minVal;i++) | |
{ |
This file contains hidden or 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
#! python | |
import zmq | |
context = zmq.Context() | |
socket = context.socket(zmq.REQ) | |
socket.connect('tcp://127.0.0.1:6000') |
This file contains hidden or 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
server{ | |
listen 80; | |
root /var/www/path/public; | |
index index.php index.html index.htm; | |
server_name server_name.dev; | |
location / { | |
try_files $uri $uri/ /index.php; |
This file contains hidden or 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
server { | |
listen 80; | |
server_name example.org; | |
access_log /var/log/nginx/example.log; | |
location / { | |
proxy_pass http://127.0.0.1:8000; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or 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
chkconfig --levels 235 mysqld on | |
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak | |
sysv-rc-conf apache2 on ( for new versions of ubuntu ) |
This file contains hidden or 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 requests | |
import json | |
def login(): | |
url = 'http://localhost/Service/service.svc/loginenduser/' | |
data = {'token': 'd8578edf8458ce06fbc5bb76a58c5ca4','email': '[email protected]','password': '123456'} | |
headers = {'content-type': 'application/json'} | |
r = requests.post(url, data=json.dumps(data), headers=headers) |
This file contains hidden or 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
$('input[data-val=number]').on('keydown', function (event) { | |
var code = event.keyCode; | |
if ( (code < 48 || code > 57) && code !== 8 ) { | |
event.preventDefault(); | |
return false; | |
} | |
}); |
OlderNewer