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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
| /* | |
| Cell compete: | |
| Eight houses, represented as a cells, are arranged as a straight line. | |
| Each days every cells competes with adjacent cells. An integer value 1 | |
| represents an active cell and a value of 0 represent an inactive cell. | |
| if the neigbour on both the sides of the cell are both active or inactive, | |
| the cell become inactive in the next day, otherwise the become active. | |
| The two cells on each or have a single adjacent cell, so asume that | |
| the onoccupied space in the opposite side is an inactive cell. even after | |
| updating the cell state, consider its previus state when updating the state |
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
| date,New York_1,San Francisco_1,Austin_1,New York_2,San Francisco_2,Austin_2 | |
| 20120101,46,53,55,8,12,13 | |
| 20120102,43,53,48,6,12,9 | |
| 20120103,30,49,41,-1,9,5 | |
| 20120104,19,52,48,-7,11,9 | |
| 20120105,32,52,54,0,11,12 | |
| 20120106,41,49,61,5,9,16 | |
| 20120107,47,51,59,8,11,15 | |
| 20120108,46,56,52,8,13,11 | |
| 20120109,34,52,54,1,11,12 |
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
| license: gpl-3.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
| license: mit |
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
| license: mit |
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 | |
| // WordPress stores the site URL in the database by default (which I have never | |
| // understood), and it's a pain to have to type out the UPDATE SQL or search in | |
| // phpMyAdmin to change it. This is a simple way to put the URL into | |
| // wp-config.php instead. | |
| // Note that you will still need to update any URLs that appear in the content, | |
| // especially when you copy a database from a development site to production: | |
| // https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5 |
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 | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| class RetryAllCommand extends Command | |
| { | |
| /** | |
| * The name and signature of the console command. |
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 | |
| // Source: http://goo.gl/qyLFbg | |
| $html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
| preg_match( '@src="([^"]+)"@' , $html, $match ); | |
| $src = array_pop($match); | |
| // will return /images/image.jpg |
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
| Description of this regular expression is as below: | |
| Passwords will contain at least 1 upper case letter | |
| Passwords will contain at least 1 lower case letter | |
| Passwords will contain at least 1 number or special character | |
| Passwords will contain at least 8 characters in length | |
| Password maximum length should not be arbitrarily limited | |
| (?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$ |
NewerOlder