Skip to content

Instantly share code, notes, and snippets.

💭
Active!

Vivek Maskara maskaravivek

💭
Active!
View GitHub Profile
@maskaravivek
maskaravivek / Bollywood Jalwa song Scrapper
Created Mar 23, 2014
Code to scrap songs from bollywood jalwa and save it in a MYSQL database.
View Bollywood Jalwa song Scrapper
<?php
$album="Single Track";
$category="pop";
$letters=range('A', 'Z');
include('config.php');
include('simple_html_dom.php');
for($l=20;$l<26;$l++)
{
$ur="http://wap.bollywoodjalwa.com/home.php?dir=Ringtones/Mp3/MP3-Hollywood_Mp3/Hollywood-".$letters[$l]."&p=0&page=1&sort=1";
$htm= file_get_html($ur);
@maskaravivek
maskaravivek / Extract quotes from goodreads
Created Mar 28, 2014
This php code uses simple_html_dom to scrap quotes along with their authors from Goodreads to a MYSQL database.
View Extract quotes from goodreads
<?php
include('config.php');
include('simple_html_dom.php');
if(!empty($_POST['name']) && !empty($_POST['number']))
{
$cat=$_POST['name'];
$no=$_POST['number'];
for($i=1;$i<$no;$i++)
{
$url="http://www.goodreads.com/quotes/tag/".$cat."?page=".$i;
@maskaravivek
maskaravivek / Custom textbox style resource in windows phone
Created Mar 29, 2014
XAML code to edit textbox style in windows phone app
View Custom textbox style resource in windows phone
<phone:PhoneApplicationPage.Resources>
<local:BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<Style x:Key="HeaderedContentControlHeaderStyle" TargetType="ContentControl">
<Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style x:Key="TextBoxHeaderStyle" BasedOn="{StaticResource HeaderedContentControlHeaderStyle}" TargetType="ContentControl">
<Setter Property="Padding" Value="0,0,0,8"/>
</Style>
@maskaravivek
maskaravivek / Copy reference database to isolated storage
Created Apr 1, 2014
This method simply moves the referenced database from the windows phone's project folder to the application's isolated storage
View Copy reference database to isolated storage
public static void MoveReferenceDatabase()
{
// Obtain the virtual store for the application.
IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication();
// Create a stream for the file in the installation folder.
using (Stream input = Application.GetResourceStream(new Uri("DutchMe.sdf", UriKind.Relative)).Stream)
{
// Create a stream for the new file in the local folder.
using (IsolatedStorageFileStream output = iso.CreateFile("DutchMe.sdf"))
@maskaravivek
maskaravivek / Excel Uploader usage
Last active Aug 29, 2015
Excel Uploader usage
View Excel Uploader usage
<?php
include 'simplexlsx.class.php';
include 'config.php';
$xlsx = new SimpleXLSX('ringtones.xlsx');
$excel = array(array());
$excel = $xlsx->rows();
for($i=1;$i<sizeof($excel);$i++){
$name = $excel[$i][0];
View simplexlsx.class.php
<?php
/*
SimpleXLSX php class v0.6.8
MS Excel 2007 workbooks reader
Example 1:
$xlsx = new SimpleXLSX('book.xlsx');
print_r( $xlsx->rows() );
Example 2:
@maskaravivek
maskaravivek / App.xaml
Last active Aug 29, 2015
Function to validate email address
View App.xaml
<Style x:Key="TokkriHeaderStyle" TargetType="ContentControl">
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="{StaticResource TokkriTheme}"/>
<Setter Property="Margin" Value="0,4,0,4"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style x:Key="TokkriTextBox" TargetType="telerikPrimitives:RadTextBox">
<Setter Property="HeaderStyle" Value="{StaticResource TokkriHeaderStyle}"/>
<Setter Property="Height" Value="108"/>
View error.php
<?php
error_reporting(-1);
//rest of php code
?>
@maskaravivek
maskaravivek / location.cs
Created Apr 17, 2014
How to check whether location is enabled on windows phone device? http://wtuts.me/LocationEnabled
View location.cs
public void locationfinder()
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
GeoCoordinateWatcher g = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
g.Start();
if (g.Permission == GeoPositionPermission.Denied)
{
App.phonelocationenabled = false;
// then we know it is off, else we assume it is on
@maskaravivek
maskaravivek / custom_message_box.cs
Created Apr 17, 2014
Using custom message box in windows phone app
View custom_message_box.cs
CustomMessageBox msg=new CustomMessageBox()
{
Caption="Location Settings",
Message="Location seems to be disabled on your device. Do your want to change your settings?",
LeftButtonContent="yes",
RightButtonContent="no"
};
msg.Dismissed += (s1, e1) =>
{
switch (e1.Result)
You can’t perform that action at this time.