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 | |
| //////////////////////// | |
| # COLUMN EXAMPLES | |
| //////////////////////// | |
| //////////////////////// | |
| # Add Column (after) | |
| //////////////////////// | |
| global $wpdb; |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 type="text/javascript"> | |
| <!-- | |
| function viewport() | |
| { | |
| var e = window | |
| , a = 'inner'; | |
| if ( !( 'innerWidth' in window ) ) | |
| { | |
| a = 'client'; | |
| e = document.documentElement || document.body; |
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 replaceBubbleFormUI( form ) { | |
| // Suppress the default bubbles | |
| form.addEventListener( "invalid", function( event ) { | |
| event.preventDefault(); | |
| }, true ); | |
| // Support Safari, iOS Safari, and the Android browser—each of which do not prevent | |
| // form submissions by default | |
| form.addEventListener( "submit", function( event ) { | |
| if ( !this.checkValidity() ) { |
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 random_password($length = 8, $allow_uppercase = true, $allow_numbers = true) { | |
| $out = ''; | |
| $arr = array(); | |
| for($i=97; $i<123; $i++) $arr[] = chr($i); | |
| if ($allow_uppercase) for($i=65; $i<91; $i++) $arr[] = chr($i); | |
| if ($allow_numbers) for($i=0; $i<10; $i++) $arr[] = $i; | |
| shuffle($arr); | |
| for($i=0; $i<$length; $i++) | |
| { | |
| $out .= $arr[mt_rand(0, sizeof($arr)-1)]; |
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 "# backbone" >> README.md | |
| git init | |
| git add README.md | |
| git commit -m "first commit" | |
| git remote add origin https://github.com/rdobrynin/backbone.git | |
| git push -u origin master | |
| git remote add origin https://github.com/rdobrynin/backbone.git | |
| git push -u origin master |
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
| @mixin image-2x($image, $width, $height) { | |
| @media (min--moz-device-pixel-ratio: 1.3), | |
| (-o-min-device-pixel-ratio: 2.6/2), | |
| (-webkit-min-device-pixel-ratio: 1.3), | |
| (min-device-pixel-ratio: 1.3), | |
| (min-resolution: 1.3dppx) { | |
| /* on retina, use image that's scaled by 2 */ | |
| background-image: url($image); | |
| background-size: $width $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
| body { | |
| font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
| font-weight: 300; | |
| } |
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 getProjectUsers($pid) { | |
| $data = array(); | |
| $query = $this->db->select('*') | |
| ->from('projects') | |
| ->join('users', 'projects.uid = users.id') | |
| ->where('projects.assign', 0) | |
| ->where('projects.pid', $pid) | |
| ->get(); | |
| if ($query->num_rows() > 0) |