Skip to content

Instantly share code, notes, and snippets.

View caionorder's full-sized avatar
🚀

Caio Norder caionorder

🚀
View GitHub Profile
angular.module('starter.services', [])
.factory('Estrutura', function($http, $q) {
var json = $http.get('/json/process.json');
return {
all: function() {
angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope) {
})
.controller('TiposCtrl', function($scope) {
})
@caionorder
caionorder / 0_reuse_code.js
Created January 18, 2017 10:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
DEFINE('SERVIDOR', 'dominio.com.br');
DEFINE('PORTA', '143');
DEFINE('USUARIO', '[email protected]');
DEFINE('SENHA', 'senha');
<?php
$avaliacoes = $this->relatoriosM->desempenho_consolidado($_POST);
$zip = new ZipArchive();
$zip->open($_SERVER['DOCUMENT_ROOT'].'/uploads/relatorio.zip', ZipArchive::CREATE);
if($zip->open($_SERVER['DOCUMENT_ROOT'].'/uploads/relatorio.zip')){
foreach ($avaliacoes as $key => $avaliacao) {
<?php
public function admin_add() {
$this->layout="Adm.admin";
$plans = $this->Income->Plan->find('list',array(
'fields'=>array(
'Plan.id','Plan.nome'
),
'order'=>array(
<?php
function callAPI($method, $url, $data, $headers = false){
$curl = curl_init();
switch ($method){
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if ($data)
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
<?php
function implodador($string, $insere = "<!--nextpage-->", $intervalo = 400){
$local_insere = $intervalo;
$contadorFull = strlen($string);
$contadorSemHtml = 1;
$flag = 0;
$textExemplo = str_split($string);
foreach( $textExemplo as $letter ){
#!/bin/bash
if [ $1 ]
then
if [ $1 == start ]
then
echo start servers.
<?php
function auto_featured_image() {
global $post;
if (!has_post_thumbnail($post->ID)) {
$attached_image = get_children( "post_parent=$post->ID&amp;post_type=attachment&amp;post_mime_type=image&amp;numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}