Skip to content

Instantly share code, notes, and snippets.

@codephi
codephi / headhunter.js
Last active August 29, 2015 14:24
Vaga Para Desenvolvedor Web com foco em Frontend ... Detalhes da vaga no script....
/** **********************
Talent wanted!
Web developer.
Focus on Frontend.
##Salary and assistance##
Salary --- R$ 2.500,00 CLT
Assistance --- R$ 400,00
##Local##
<?php
$localidades = ['logradouro', 'bairro', 'cidade', 'cep', 'pais'];
$conditions = [];
do{
if(isset($this->request->data[current($localidades)]))
$conditions['l.'.current($localidades)] = '%'.$this->request->data[current($localidades)].'%';
}
while(next($localidades));
@codephi
codephi / 0_reuse_code.js
Created October 12, 2015 09:10
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
DROP TABLE IF EXISTS `files`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`path` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`users_id` int(11) NOT NULL,
`created` datetime NOT NULL,
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</virtualhost>
Listen 443
<VirtualHost *:443>
ServerAdmin zadmin@localhost
DocumentRoot "/etc/sentora/panel/"
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(SpriteRenderer))]
public class RepeatSpriteBoundary : MonoBehaviour
{
SpriteRenderer sprite;
void Awake()
{
using UnityEngine;
using System.Collections;
public static class SpritePivotAlignment
{
public static SpriteAlignment GetSpriteAlignment(GameObject SpriteObject)
{
BoxCollider2D MyBoxCollider = SpriteObject.AddComponent<BoxCollider2D>();
float colX = MyBoxCollider.offset.x;
float colY = MyBoxCollider.offset.y;
#!/bin/bash
LD_PRELOAD=/lib/x86_64-linux-gnu/libresolv.so.2 /opt/Unity/Editor/Unity
@codephi
codephi / keystone-express-vhost.js
Created July 20, 2016 21:48
Using KeystoneJs with Express-vhost to work with multiple sites on the same port.
var path = require('path'),
evh = require('express-vhost'),
express = require('express'),
server = express();
/**
* express-vhost
**/
server.use(evh.vhost(server.enabled('trust proxy')));
server.listen(3000); //port 3000
alias mongorestart="sudo rm /var/lib/mongodb/mongod.lock && sudo service mongod restart"
alias bashrc="source ~/.bashrc"
gitall(){
if [ -z "$1" ]; then
git add --all && git commit -m all && git push origin master
else
git add --all && git commit -m \"$1\" && git push origin master
fi
}