Skip to content

Instantly share code, notes, and snippets.

View mkarnicki's full-sized avatar

Michał Karnicki mkarnicki

View GitHub Profile
@thorikawa
thorikawa / build.xml
Created February 26, 2012 18:42
improved build.xml for Android SDK r16
<?xml version="1.0" encoding="UTF-8"?>
<project name="android_rules" default="debug">
<!--
This build file is imported by the project build file. It contains
all the targets and tasks necessary to build Android projects, be they
regular projects, library projects, or test projects.
At the beginning of the file is a list of properties that can be overridden
by adding them to your ant.properties (properties are immutable, so their
@JakeWharton
JakeWharton / ActionBarSherlockRobolectric.java
Created September 29, 2012 05:42
Making Robolectric suck less... (barely)
// Copyright 2012 Square, Inc.
package com.squareup.test;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.internal.ActionBarSherlockCompat;
@elliotlings
elliotlings / gist:7629783
Created November 24, 2013 17:24
Custom Laravel 4 asset function for static subdomain.
<?php
function asset($path, $secure = null)
{
if (app('url')->isValidUrl($path)) return $path;
if (is_null($secure))
{
$scheme = app('url')->getRequest()->getScheme($secure) . '://';
@mirzabusatlic
mirzabusatlic / FixCashierNamespace.php
Last active October 21, 2018 08:25
Add a sub-namespace to Laravel Cashier when using both Stripe and Braintree packages
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Finder\Finder;
class FixCashierNamespace extends Command
{
/**
@igrigorik
igrigorik / gist:3148848
Created July 20, 2012 05:24
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@mystix
mystix / border-glow.css
Last active March 17, 2019 18:03
CSS Glow Effect
a:hover {
/* border glow effect on hover */
box-shadow: 0px 0px 20px #000;
filter:progid:DXImageTransform.Microsoft.Glow(Color=black,Strength=20);
}
autosize
axios
chart.js
collect.js
copy-to-clipboard
delegate
dom-autoscroller
dropzone
electron
emoji-regex
@geoffreydhuyvetters
geoffreydhuyvetters / refactoring.md
Last active March 19, 2020 17:01
refactoring rendering

BEFORE

const Component = () = {

  // a
  // lot
  // of 
 // logic
@simonhamp
simonhamp / BaseModel.php
Last active March 25, 2020 16:57
Eloquent: Simple Model Event Handling
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class BaseModel extends Model
{
/**
* Override the default boot method to register some extra stuff for every child model.
@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart