Skip to content

Instantly share code, notes, and snippets.

View nekofar's full-sized avatar
💭
I may be slow to respond.

Milad Nekofar nekofar

💭
I may be slow to respond.
View GitHub Profile
@unisys12
unisys12 / SessionController.php
Created February 11, 2014 18:51
Phalcon Authentication Issue [Note] This was actually an issue with me having my column length, in my users table, too short. Instead of 60 chars max, I had it at 50 chars max. DOH![/NOTE]
<?php
class SessionController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
// Will display users profile... once logged in
}
@BoniGauglitz
BoniGauglitz / build.gradle
Created October 2, 2014 14:43
Simple ProGuard snippet for Android Studio
android{
buildTypes {
debug {
debuggable true
runProguard false
}
release {
debuggable false
runProguard true
proguardFile getDefaultProguardFile ('proguard-android.txt')
@frogermcs
frogermcs / CommentsActivity_enter_transition.java
Last active August 29, 2015 14:10
InstaMaterial source files (comments transitions)
public class CommentsActivity extends ActionBarActivity {
public static final String ARG_DRAWING_START_LOCATION = "arg_drawing_start_location";
@InjectView(R.id.toolbar)
Toolbar toolbar;
@InjectView(R.id.contentRoot)
LinearLayout contentRoot;
@InjectView(R.id.rvComments)
RecyclerView rvComments;
@InjectView(R.id.llAddComment)
@matheusjardimb
matheusjardimb / android_colors
Last active August 29, 2015 14:12
Great Flat Colors
<?xml version="1.0" encoding="utf-8"?>
<!--
Great set of colors from from http://flatuicolors.com/ and converted into Android colors.xml
-->
<resources>
<color name="turquoise">#1abc9c</color>
<color name="emerald">#2ecc71</color>
<color name="peter_river">#3498db</color>
@phpdistiller
phpdistiller / get_tweets_by_hashtag.php
Last active January 1, 2016 00:29
This snippet gets all tweets of a specific hashtag.
<?php
// Source : http://www.inkplant.com/code/get-twitter-posts-by-hashtag.php
function getTweets($hash_tag) {
$url = 'http://search.twitter.com/search.atom?q='.urlencode($hash_tag) ;
echo "<p>Connecting to <strong>$url</strong> ...</p>";
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$xml = curl_exec ($ch);
@mkuprionis
mkuprionis / DebugApiModule.java
Last active February 3, 2016 16:07
Retrofit API wrapper to be used when testing with Espresso
@Module(
complete = false,
library = true,
overrides = true
)
public final class DebugApiModule {
@Provides @Singleton ApiEndpoint provideApiEndpoint(Locale locale, @ApiEndpointMarker StringPreference apiEndpoint,
@NetworkIgnoreLocale BooleanPreference ignoreLocale) {
return (ignoreLocale.get())
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import com.koushikdutta.async.AsyncNetworkSocket;
import com.koushikdutta.async.AsyncServer;
import com.koushikdutta.async.AsyncServerSocket;
import com.koushikdutta.async.AsyncSocket;
import com.koushikdutta.async.ByteBufferList;
@tsohr
tsohr / gist:7942113
Last active September 6, 2017 06:35
7zip command line execution example, 7zip format, LZMA2, multithreading
# not working
#7za a -r -t7z -m=Deflate64 -mt=12 $FILE_OUT $A_DIR
7za a -r -t7z -m0=LZMA2 -mmt=on $FILE_OUT $A_DIR
#http://7zip.bugaco.com/7zip/MANUAL/switches/method.htm#ZipMultiThread
#mt=[off | on | {N}]
#Sets multithread mode. If you have a multiprocessor or multicore system, you can get a speed increase with this switch. This option #affects only compression with BZip2, Deflate and Deflate64 methods and decompression of BZip2 streams.
#Each thread in the multithread mode uses 32 MB of RAM for buffering. If you specify {N}, 7-Zip tries to use N threads.
@joerx
joerx / genymotion.desktop
Created June 28, 2014 05:59
genymotion.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Genymotion
Comment=Alternative Android Emulator based on VirtualBox
Exec=/opt/genymotion/genymotion
Icon=/opt/genymotion/icons/icon.png
NoDisplay=false
Terminal=false
Type=Application
Categories=Application;Development;
if [ ! -e ~/.antigen/source/antigen.zsh ];then
mkdir ~/.antigen
git clone https://github.com/zsh-users/antigen.git ~/.antigen/source
fi;
if [ ! -e "$HOME/.scm_breeze/scm_breeze.sh" ];then
git clone git://github.com/scmbreeze/scm_breeze.git ~/.scm_breeze
fi;
source ~/.antigen/source/antigen.zsh