Skip to content

Instantly share code, notes, and snippets.

View fabiobruna's full-sized avatar

Fabio Bruna fabiobruna

View GitHub Profile
@fabiobruna
fabiobruna / extjs-store-error.js
Created August 19, 2014 20:21
Extjs error handeling, uitzoeken.
store.load({
params: {
'param1':waardel,
'param2': waarde2
},
callback:function(records, operation, success){
msg.hide();
if(success === true){
if(records.length === 0){
Ext.Msg.alert('Resultaat', 'Nix');
@fabiobruna
fabiobruna / extjs-ajax-error-handeling.js
Last active August 29, 2015 14:05
JS afvangen, varianten. Uitzoeken.
Ext.Ajax.request({
url: 'bestandje.ofzo',
// method: 'POST',
params: {
a: a,
b: b
},
success: function(xhr){
var jResponse = Ext.decode(xhr.responseText);
if (jResponse.success === true) {
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
<?php function base64_encode_image ($filename=string,$filetype=string) {     if ($filename) {         $imgbinary = fread(fopen($filename, "r"), filesize($filename));         return 'data:image/' . $filetype . ';base64,' . base64_encode($imgbinary);     } } ?> used as so <style type="text/css"> .logo {     background: url("<?php echo base64_encode_image ('img/logo.png','png'); ?>") no-repeat right 5px; } </style> or <img src="<?php echo base64_encode_image ('img/logo.png','png'); ?>"/>

Keybase proof

I hereby claim:

  • I am fabiobruna on github.
  • I am fabiobruna (https://keybase.io/fabiobruna) on keybase.
  • I have a public key whose fingerprint is 90A0 0CC0 4C5C D56C A81D 3A97 693E ACE5 C27E D900

To claim this, I am signing this object:

@fabiobruna
fabiobruna / php.sublime-build
Created June 9, 2015 08:57
PHP Lint build system for sublime text 3
{
"cmd": ["php", "-l", "$file"],
"selector": "source.php"
}
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@fabiobruna
fabiobruna / terminator-config
Created November 22, 2015 07:04 — forked from jacaetevha/terminator-config
save this file to ~/.config/terminator/config
[global_config]
enabled_plugins = CustomCommandsMenu, InactivityWatch, TestPlugin, ActivityWatch, TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, MavenPluginURLHandler, LaunchpadBugURLHandler, LayoutManager
title_transmit_bg_color = "#832527"
[keybindings]
[profiles]
[[default]]
scrollback_lines = 4000
[layouts]
[[default]]
[[[child1]]]
@fabiobruna
fabiobruna / ext-periode.js
Created December 16, 2015 09:28
Periode voor header halen
var HEADER = Ext.ComponentQuery.query('#ELEMENT')[0];
Ext.Ajax.request({
url: 'BESTAND.BESTAND',
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
if (obj.success == true) {
HEADER.setTitle('BLABLA' + obj.periode);
}
},
$echo -n 😕 | hexdump
0000000 f0 9f 98 95
0000004
$echo -e "\xf0\x9f\x98\x95"
😕
$PS1=$'\xf0\x9f\x98\x95 >'
😕 >