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
# create the password file for user 'admin' | |
sudo htpasswd -c /etc/nginx/.htpasswd admin |
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
# maximum capability of system | |
user@ubuntu:~$ cat /proc/sys/fs/file-max | |
96872 | |
# current available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 200000 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf |
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
<?php | |
class SomeStaticClass | |
{ | |
public static function doTest($i) { | |
sqrt($i); | |
} | |
} | |
class SomeClass |
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 python3 | |
from src import npyscreen | |
import curses | |
class App(npyscreen.StandardApp): | |
def onStart(self): | |
self.addForm("MAIN", MainForm, name="Hello Medium!") | |
class InputBox1(npyscreen.BoxTitle): | |
_contained_widget = npyscreen.MultiLineEdit |
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 python3 | |
from src import npyscreen | |
import random | |
class App(npyscreen.StandardApp): | |
def onStart(self): | |
# Set the theme. DefaultTheme is used by default | |
npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) | |
self.addForm("MAIN", MainForm, name="Hello Medium!") |
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 python3 | |
import npyscreen | |
class App(npyscreen.StandardApp): | |
def onStart(self): | |
self.addForm("MAIN", MainForm, name="Hello Medium!") | |
class MainForm(npyscreen.FormBaseNew): | |
def create(self): | |
# Get the space used by the form |
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 python3 | |
import npyscreen | |
class App(npyscreen.StandardApp): | |
def onStart(self): | |
self.addForm("MAIN", MainForm, name="Hello Medium!") | |
class MainForm(npyscreen.ActionForm): | |
# Constructor | |
def create(self): |
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
<?php | |
class MySQL | |
{ | |
var $link; | |
function __construct() | |
{ | |
include_once dirname(__FILE__) . '/config.php'; | |
$this->link = mysqli_connect( | |
config\MYSQL_HOST, |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script> | |
// your next score | |
need_score = 999999; | |
// part of game url, you can find this in network monitor on your browser. Find POST with "set-web-score*", when game is over | |
var game_url = '*GAME URL*'; |