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
| // ==UserScript== | |
| // @name Flickr All Images Size | |
| // @namespace https://greasyfork.org/scripts/6850-flickr-all-images-size | |
| // @include /flickr\.com\/(photos|groups|search)\// | |
| // @version 4.3.7 | |
| // @grant GM_getValue | |
| // @grant GM_setValue | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js | |
| // @description Show direct links to all Flickr image sizes. | |
| // ==/UserScript== |
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
| $.fn.protectImage = (settings) -> | |
| settings = jQuery.extend( | |
| zIndex: 10 | |
| offset: 0 | |
| , settings) | |
| @each -> | |
| thisImg = $(this) | |
| position = thisImg.offset() | |
| height = thisImg.height() |
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
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
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
| /** | |
| * Check emoji from string | |
| * | |
| * @return bool if existed emoji in string | |
| */ | |
| public static function checkEmoji($str) | |
| { | |
| $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; | |
| preg_match($regexEmoticons, $str, $matches_emo); | |
| if (!empty($matches_emo[0])) { |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| public function secondsToTime($value) | |
| { | |
| $hours = 0; | |
| $minutes = 0; | |
| if (filter_var($value)) { | |
| $hours = str_pad(floor($value / (60 * 60)), 2, '0', STR_PAD_LEFT); | |
| $minutes = str_pad(floor(($value - $hours * 60 * 60) / 60), 2, '0', STR_PAD_LEFT); | |
| } | |
| $timeString = Yii::t('app', '{hours} hours {minutes} minutes', ['hours' => $hours, 'minutes' => $minutes]); |
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
| DEVICE=eth1 | |
| HWADDR=08:00:27:20:6F:25 | |
| TYPE=Ethernet | |
| UUID=e992fe95-72ff-4efe-8aac-5b00f09a5fb4 | |
| ONBOOT=yes | |
| NM_CONTROLLED=no | |
| BOOTPROTO=static | |
| IPADDR=192.168.56.103 | |
| NETMASK=255.255.255.0 |
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/sh | |
| for i in 1 2 3; do sudo hdparm -tT /dev/sda; done | |
| #/dev/sda: | |
| # Timing cached reads: 9676 MB in 2.00 seconds = 4839.70 MB/sec | |
| # Timing buffered disk reads: 326 MB in 3.01 seconds = 108.28 MB/sec | |
| # | |
| #/dev/sda: | |
| # Timing cached reads: 9910 MB in 2.00 seconds = 4957.12 MB/sec | |
| # Timing buffered disk reads: 292 MB in 3.01 seconds = 97.15 MB/sec |
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
| /** | |
| * Check emoji from string | |
| * | |
| * @return bool if existed emoji in string | |
| */ | |
| function checkEmoji($str) | |
| { | |
| $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; | |
| preg_match($regexEmoticons, $str, $matches_emo); | |
| if (!empty($matches_emo[0])) { |
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
| # Aliases in this file are bash and zsh compatible | |
| alias -g ...='../..' | |
| alias -g ....='../../..' | |
| alias -g .....='../../../..' | |
| alias -g C='| wc -l' | |
| alias -g H='| head' | |
| alias -g L="| less" | |
| alias -g N="| /dev/null" | |
| alias -g S='| sort' | |
| alias -g G='| grep' # now you can do: ls foo G something |