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
| <script> | |
| var docwritebuffer = ""; | |
| document.wrong = document.write; | |
| document.write = function(html){ | |
| docwritebuffer = html; | |
| } | |
| </script> | |
| <script type="text/javascript" src="http://myforum.disqus.com/popular_threads_widget.js?num_items=5"></script> | |
| <script> | |
| document.write = document.wrong; |
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
| <?php | |
| // Usage: | |
| // $master=new WebSocket("localhost",12345); | |
| // $master->callback = function($self, $user, $msg){ | |
| // $self->send($user->socket,$msg); | |
| // }; | |
| require "CommandsAppBase.class.php"; | |
| require "WsRequest.class.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
| // respond to key events | |
| Game.Player.prototype.keyUp = function (e) { | |
| delete this._keysPressed[e.key]; | |
| }; | |
| // respond to key events | |
| Game.Player.prototype.keyDown = function (e) { | |
| this._keysPressed[e.key] = true; |
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
| let lastPage = 25; | |
| let self = this; | |
| function getPage(thisPage) { | |
| console.log('Loading page', thisPage); | |
| fetch(self.state.url + '&page=' + thisPage) | |
| .then(response => { | |
| if (response.headers.has('X-WP-TotalPages')) { | |
| lastPage = response.headers.get('X-WP-TotalPages'); | |
| } | |
| return response.json(); |
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
| <?php | |
| function get_cache($key) { | |
| $cacheFolder = '/tmp/wp-site/'; | |
| $cacheFile = $cacheFolder+$key | |
| if(file_exists($cacheFile) { | |
| $contents = file_read($cacheFile); | |
| return json_decode($contents); | |
| } else { | |
| return false; |
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
| hs.hotkey.bind({"cmd", "alt", "ctrl"}, "O", function() | |
| hs.notify.new({title="Hammerspoon", informativeText="Hello World"}):send() | |
| end) | |
| -- Move window up | |
| hs.hotkey.bind({"cmd", "alt", "ctrl"}, "W", function() | |
| local win = hs.window.focusedWindow() | |
| local f = win:frame() |
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 cpu_load() { | |
| ps -A -o %cpu | awk '{s+=$1} END {print s "%"}' | |
| } | |
| function battery_load() { | |
| pmset -g batt | grep -o '[0-9]*%' | tr -d % | |
| } | |
| export PS1='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;37m\]\u\[\033[01;36m\] \[\033[01;33m\]\t \[\033[01;37m\]($(cpu_load)) [\[\033[01;33m\]$(battery_load)⚡\[\033[01;37m\]] \[\033[01;36m\]\W\[\033[35m\]$(__git_ps1 " %s") \[\033[01;37m\]⚡\[\033[00m\] ' |
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
| { | |
| "files.exclude": { | |
| "**/.git": true, | |
| "**/.svn": true, | |
| "**/.hg": true, | |
| "**/.DS_Store": true, | |
| "**/tmp": true, | |
| "**/yarn_cache": true | |
| // "**/env": true | |
| }, |
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
| # install dependencies | |
| sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm | |
| # clone cpuminer | |
| git clone https://github.com/pooler/cpuminer.git | |
| # compile | |
| cd cpuminer | |
| ./autogen.sh | |
| ./configure CFLAGS="-O3" |
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
| #!/bin/bash | |
| # from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
| # and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
| ############################################### | |
| # To use: | |
| # wget https://gist.github.com/thrashr888/6047603/raw/6584ab9c5d500613303c852d79d619690b835305/install-redis.sh | |
| # chmod 777 install-redis.sh | |
| # ./install-redis.sh | |
| ############################################### | |
| echo "*****************************************" |
NewerOlder