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
| #! /usr/bin/env node | |
| // I am ./bin/buildSitemap.js | |
| const path = require('path') | |
| const glob = require('glob') | |
| const fs = require('fs') | |
| const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
| const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
| const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |
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
| // here's a handy trick: | |
| /* | |
| console.log('any code') | |
| /**/ | |
| // It takes just one character change |
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 | |
| //An Regular Expression Parser for Time followed by a text | |
| function check_for_time() | |
| { | |
| //we are following 24 hour clock pattern | |
| $string = "02:00 am I am still working"; | |
| $pattern = "/([01]?[0-9]|2[0-3]):[0-5][0-9]/"; | |
| if (preg_match($pattern, $string, $matches)) { | |
| echo "<br/>Match was found <br />"; |
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
| SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString); | |
| { | |
| SqlCommand cmd = conn.CreateCommand(); | |
| cmd.CommandText = "SELECT IDENT_CURRENT('tbl') + IDENT_INCR('tbl') FROM tbl"; | |
| Decimal next_id; | |
| try | |
| { | |
| conn.Open(); | |
| next_id = Convert.ToDecimal(cmd.ExecuteScalar()); |
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
| <!--<add name="dbconnection" connectionString="Data Source=ALLEN-HOME\SQLEXPRESS;Initial Catalog=royaldb;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>--> | |
| <add name="dbconnection" connectionString="Data Source=IDCSQL2.znetlive.com,1234;database=db;uid=al;password=biz1$#;" providerName="System.Data.SqlClient"/> | |
| <!--<add name="dbconnection" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\royaldb.mdb;Persist Security Info=True;" providerName="System.Data.OleDb" />--> | |
| 'Get connection string from web.config file | |
| Dim strcon As String = ConfigurationManager.ConnectionStrings("dbconnection").ConnectionString |