Skip to content

Instantly share code, notes, and snippets.

View clemblanco's full-sized avatar
✌️

Clem Blanco clemblanco

✌️
View GitHub Profile
@clemblanco
clemblanco / phpcs.xml
Created January 18, 2021 14:15
PHPCS PHPStorm XML Seetings
<code_scheme name="phpcs" version="173">
<option name="RIGHT_MARGIN" value="999" />
<option name="SOFT_MARGINS" value="120" />
<JSCodeStyleSettings version="0">
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="VAR_DECLARATION_WRAP" value="2" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
@clemblanco
clemblanco / cloudSettings
Created November 12, 2017 00:04 — forked from spencercarli/bd3d4befe38185704bf0fc875e9deed6|configuration.json
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-11-07T15:26:14.191Z","extensionVersion":"v2.8.5"}
@clemblanco
clemblanco / codeship_pdfnet.sh
Last active March 25, 2019 18:45
PDFNetPHP PHP extension compilation and installation for Codeship
#!/bin/bash
mkdir PDFNetPHPSetup
cd PDFNetPHPSetup && wget https://github.com/PDFTron/PDFNetWrappers/archive/d5a24e199524b9c61b3d10ff880a76f816e3f480.tar.gz
tar xzvf d5a24e199524b9c61b3d10ff880a76f816e3f480.tar.gz
cd PDFNetWrappers-d5a24e199524b9c61b3d10ff880a76f816e3f480/PDFNetC
wget http://www.pdftron.com/downloads/PDFNetC64.tar.gz && tar xzvf PDFNetC64.tar.gz
mv PDFNetC64/Headers/ . && mv PDFNetC64/Lib/ .
cd .. && mkdir Build && cd Build
cmake -D BUILD_PDFNetPHP=ON .. && make && make install
@clemblanco
clemblanco / main.js
Created March 18, 2016 17:20
Parse - CloudCode - Retrieve all objects from a specific Parse class without limitation
Parse.Cloud.define("retrieveAllObjects", function(request, status) {
var result = [];
var chunk_size = 1000;
var processCallback = function(res) {
result = result.concat(res);
if (res.length === chunk_size) {
process(res[res.length-1].id);
} else {
status.success(result);
}
@clemblanco
clemblanco / hex2rgba-rgba2hex.php
Last active June 17, 2022 09:22
Convert RGBA into HEXADECIMAL or HEXADECIMAL into RGBA with transparency support.
<?php
function hex2rgba($hex) {
$hex = str_replace("#", "", $hex);
switch (strlen($hex)) {
case 3 :
$r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));
$g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));
$b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));
@clemblanco
clemblanco / anystyle.tss
Created September 4, 2015 11:43
Titanium - Alloy Framework - Defining an using a theme.
```javascript
"#button": {
// ...
backgroundColor: Alloy.CFG.design.mainColor,
// ...
}
```
@clemblanco
clemblanco / php.nanorc
Created March 10, 2015 10:08
Nano PHP Color Syntax
# /usr/share/nano/php.nanorc
syntax "php" "\.php[2345s~]?$"
color brightblue start="<\?(php)?" end="\?>"
color blue start="<[^\?]" end="[^\?]>"
color magenta "\$[a-zA-Z_0-9]*"
color cyan "(\[)|(\])"
color cyan "(function|extends|use|namespace|var|class|function|echo|case|break|default|exit|switch|if|else|elseif|@|while)\s"
color cyan "parent\:\:"
color cyan "function\s[a-zA-Z_0-9]*"
@clemblanco
clemblanco / blade-trans.sublime-snippet
Last active August 29, 2015 14:16
blade-trans.sublime-snippet
<snippet>
<content><![CDATA[
{{ trans('${1:langfilename}.${2:identifier}'${3:, array('${4:variable}' => '${5:replacement}')}) }}
]]></content>
<tabTrigger>ltrans</tabTrigger>
<scope>text.html.laravel-blade</scope>
<description>Laravel localization of a string using Blade templating.</description>
</snippet>
@clemblanco
clemblanco / Homestead.yml
Created November 26, 2014 14:55
Homestead
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
@clemblanco
clemblanco / publish.html.twig
Created May 30, 2013 10:58
Publish View from PointsFB
{% extends '::base.html.twig' %}
{% block content_back %}
{{' participated'}}
{% endblock content_back %}
{% block content %}
{% for key, flash in app.session.getFlashes() %}
<div class="center red {{ key }}"><p>{{ flash }}</p></div>