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
var ParallaxManager, ParallaxPart; | |
ParallaxPart = (function() { | |
function ParallaxPart(el) { | |
this.el = el; | |
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed')); | |
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll')); | |
} | |
ParallaxPart.prototype.update = function(scrollY) { |
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 signal | |
class TimeOut(Exception): | |
def __init__(self, msg='Time out error'): | |
super(Exception, self).__init__(msg) | |
def on_alarm(signum, frame): # при надходженні сигналу кидати виняток | |
raise TimeOut() | |
def limit_time(t, default=None): |
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
# You can instead use str.translate: | |
line = line.translate(None, '!@#$') | |
# — which only works on Python 2.6 and newer Python 2.x versions * — | |
# or regular expression replacement with re.sub | |
import re | |
line = re.sub('[!@#$]', '', line) |
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
### create new dir | |
### cd dir | |
p4_newclient -modules # list of all modules | |
p4_newclient -c username:project_directory:freebsd_client_name repo_name # create client | |
# check view in the client regarding project needs | |
p4 client -o # check client settings | |
p4 sync # download files from repo | |
python co_helper.py # download dependencies |
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
find ~/path/to/file -type f | xargs grep -i "STRING" |
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
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
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 os | |
hostname = "google.com" #example | |
response = os.system("ping -c 1 " + hostname) | |
#and then check the response... | |
if response == 0: | |
print hostname, 'is up!' | |
else: | |
print hostname, 'is down!' |
NewerOlder