Skip to content

Instantly share code, notes, and snippets.

View echirchir's full-sized avatar

Elisha Chirchir echirchir

View GitHub Profile
public class ApiModule {
private TwitterApi mApi;
public void init(String token, String tokenSecret) {
OAuthConsumer consumer = new DefaultOAuthConsumer(
Config.TWEET_API_KEY,
Config.TWEET_API_SECRET);
consumer.setTokenWithSecret(token, tokenSecret);
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
@SuppressWarnings("CanBeFinal")
private OnItemClickListener mListener;
public interface OnItemClickListener {
void onItemClick(View view, int position);
}
@SuppressWarnings("CanBeFinal")
private GestureDetector mGestureDetector;
object(PHPMailer)#2193 (73) {
["Version"]=>
string(6) "5.2.10"
["Priority"]=>
int(3)
["CharSet"]=>
string(5) "UTF-8"
["ContentType"]=>
string(10) "text/plain"
["Encoding"]=>
@echirchir
echirchir / List.md
Created March 19, 2016 07:45 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

private static ArrayList<String> possibilities = new ArrayList<>();
public static void main(String[] args) {
String s = "abcd";
loop(s, null);
for(String string : possibilities)
System.out.println(string);
}
<table width="50%" border="1">
<tr>
<th rowspan="2">YEAR</th>
<th colspan="2">Student Details</th><th colspan="4">Registered Examinations</th>
<tr>
<td>Student Reg. No</td>
<td>Student Names</td>
<td>BIT 1101</td>
@echirchir
echirchir / Promotions.java
Last active May 24, 2018 21:57
PromotionManager.java
public void applyPromotionMatrix(CashOrder cashOrder, int item_id){
SpecialPromoPrice promoPrice = realm.where(SpecialPromoPrice.class).equalTo("itemId", item_id).findFirst();
Product product;
if (promoPrice != null){
int freeItems = Integer.parseInt(promoPrice.getQuantity());
@echirchir
echirchir / demo.rake
Created January 10, 2020 23:34 — forked from edavis10/demo.rake
Rake tasks to create tons of data for Redmine
# Still a work in progress but is good enough for development
#
# `rake redmine:demo_data` for it all
# `rake redmine:demo_data:users`
# `rake redmine:demo_data:projects`
# `rake redmine:demo_data:issues`
# `rake redmine:demo_data:time_entries`
require 'faker'
require 'random_data'