Skip to content

Instantly share code, notes, and snippets.

View ogulcan's full-sized avatar
🎯
Focusing

Ogulcan Orhan ogulcan

🎯
Focusing
View GitHub Profile
# This is will be called by bitbucket pipeline
echo "Deploy script started"
cd /var/www/
sh pull.sh
echo "Deploy script finished execution."
@ogulcan
ogulcan / gist:3303243
Created August 9, 2012 10:53
Android Version Name and Code
public static String getApplicationVersionString(Context context) {
try {
PackageManager pm = context.getPackageManager();
PackageInfo info = pm.getPackageInfo(context.getPackageName(), 0);
return info.versionName;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.WebView;
public class CustomWebView extends WebView {
public CustomWebView(Context context) {
super(context);
}
@ogulcan
ogulcan / FacultyController.php
Created March 2, 2012 22:49
Yii Controller
<?php
class FacultyController extends Controller
{
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout = '//layouts/column2';
<schema name="example core zero" version="1.1">
<types>
<fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
</types>
<fields>
<!-- general -->
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="type" type="string" indexed="true" stored="true" multiValued="false" />
<field name="name" type="string" indexed="true" stored="true" multiValued="false" />
@ogulcan
ogulcan / custom_adapter.java
Created February 18, 2012 22:56
Custom ArrayAdapter Example
public class CustomAdapter extends ArrayAdapter<Tip> {
Context context; // LoayutInflater için gerekli.
ArrayList<Tip> objects; // Gelecek verileri karşılamak için gerekli
public CustomAdapter(Context applicationContext, int dovizLayout, ArrayList<String> Tips) {
super(applicationContext, dovizLayout);
this.context = applicationContext;
this.objects = (ArrayList) Tips;
}