Skip to content

Instantly share code, notes, and snippets.

View vinicius73's full-sized avatar
🤓
"Those who cannot acknowledge themselves, will eventually fail."

Vinicius Reis vinicius73

🤓
"Those who cannot acknowledge themselves, will eventually fail."
View GitHub Profile
@granoeste
granoeste / gist:1026558
Created June 15, 2011 05:55
[Android][WiFi]Wi-Fi Scan Results
final WifiManager mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
if(mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED) {
// register WiFi scan results receiver
IntentFilter filter = new IntentFilter();
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
registerReceiver(new BroadcastReceiver(){
@Override
@maxxscho
maxxscho / custom_post_type_slider_image.php
Created March 7, 2012 10:17
Wordpress: Custom Post Type Template
<?php
/* !-------- CUSTOM POST TYPE ------------------- */
/*------------------------------------------------------------ */
/**
* This is a Template for a Custom Post Type, in this case a Slider Image Post Type.
* I use this Post Type for Slideshows like Flexslider.
* Copy this file and/or customize it for you needs.
*/
@maxxscho
maxxscho / EmptyWidget.php
Created March 7, 2012 10:24 — forked from jonathonbyrdziak/CustomWidgetFile.php
Wordpress: Plugin code to create a single widget in wordpress.
<?php
/**
* @package RedRokk
* @version 1.0.0
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Empty_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@kris-g
kris-g / Twitter Bootstrap Radio Button Form Inputs.html
Created July 13, 2012 22:01
Clean way to bind result value of bootstrap radio buttons to a single form input
<form>
<div class="btn-group" data-toggle-name="is_private" data-toggle="buttons-radio" >
<button type="button" value="0" class="btn" data-toggle="button">Public</button>
<button type="button" value="1" class="btn" data-toggle="button">Private</button>
</div>
<input type="hidden" name="is_private" value="0" />
</form>
@spencerdeinum
spencerdeinum / softdelete.php
Created August 9, 2012 15:27
Soft Delete example for Laravel
<?php
class Softdelete extends HealthieModel
{
protected function query()
{
return new SoftDeleteQuery($this);
}
public function delete()
@jonatanfroes
jonatanfroes / MY_Form_validation.php
Created August 20, 2012 14:16
CodeIgniter My_Form_validation p/ validação de CPF e outros
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* MY_Form_validation Class
*
* Extends Form_Validation library
*
*/
class MY_Form_validation extends CI_Form_validation {
function __construct()
<?php
/**
* Bcrypt hashing class
*
* @author Thiago Belem <contato@thiagobelem.net>
* @link https://gist.github.com/3438461
*/
class Bcrypt {
@vinicius73
vinicius73 / ci.php
Created August 27, 2012 14:41
Integração Codeigniter com NetBeans
<?php
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
* @property CI_Calendar $calendar
* @property CI_Cart $cart
* @property CI_Config $config
* @property CI_Controller $controller