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
| server { | |
| listen 80; | |
| server_name ~^(www\.)?(?<sname>.+?).local.com$; | |
| root /var/www/$sname/public; | |
| index index.html index.htm index.php; | |
| charset utf-8; | |
| location / { |
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
| # Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html | |
| MyEntity: | |
| type: entity | |
| repositoryClass: MyRepositoryClass | |
| table: my_entity | |
| namedQueries: | |
| all: "SELECT u FROM __CLASS__ u" | |
| # Class-Table-Inheritance |
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
| /** | |
| * @example Object.byString(someObject, 'part1.name') | |
| * @example Object.byString(someObject, 'part2.qty') | |
| * @example Object.byString(someObject, 'part3[0].name') | |
| * | |
| * @param obj {Object} | |
| * @param str {String} | |
| * @returns {*} | |
| */ | |
| Object.byString = function(obj, str) { |
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
| $image = "/(<a[^<]+\>[^<]*|)\<img [^<]+\>([^<]*\<\/a\>|)/ism"; |
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 . -name "*.jsp" -exec fconv {} \; |
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
| SELECT | |
| `sights_lang`.`name`, | |
| `sights_lang`.`address`, | |
| `sights`.`category_id`, | |
| `sights_categories_lang`.` | |
| categoryName`, | |
| `sights`.`latitude`, | |
| `sights`.`longitude`, | |
| `sights`.`sights_id` | |
| FROM `partner_hotels`.`sights_lang` |
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
| Object.path = Object.byString = function(obj, str, undefined) { | |
| if (str in obj) { | |
| return obj[str]; | |
| } | |
| if ((!str.length) || (null === obj)) { | |
| return obj; | |
| } | |
| var a = str.replace(/\[(\w+)\]/g, '.$1').replace(/^\./, '').split('.'); // convert indexes to properties and strip a leading dot | |
| for (var i = 0, n = a.length; i < n; ++i) { | |
| var k = a[i]; |
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
| preg_replace('/((?:href|src) *= *[\'"](?!(\/\/|#|http|ftp)))/i', '$1' . $this->url, $value) |
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
| package org.timeout.app | |
| import java.math.BigInteger | |
| class NumberSystem(val alphabet: String = "0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ") { | |
| val base = alphabet.length.toBigInteger() | |
| fun encode(input: String): String { | |
| val number = BigInteger(1, input.toByteArray()) | |
| val encoded = StringBuilder() | |
| var num = number |
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/files* -mtime +5 -exec rm {} \; |