Skip to content

Instantly share code, notes, and snippets.

View xerardoo's full-sized avatar
🎯
Focusing

Lucio G Pazos xerardoo

🎯
Focusing
View GitHub Profile
@gnikolopoulos
gnikolopoulos / functions.php
Created August 27, 2015 10:47
Add Defer and Async Attributes to Render Blocking Javascript in WordPress
<?php
function defer_js_async($tag){
// scripts to defer.
$scripts_to_defer = array('script-name1.js', 'script-name2.js', 'script-name3.js');
// scripts to async.
$scripts_to_async = array('script-name1.js', 'script-name2.js', 'script-name3.js');
foreach($scripts_to_defer as $defer_script){
@dyve
dyve / bootstrap-tables2.css
Created April 25, 2013 08:00
Bootstrap template for django-tables2 (https://github.com/bradleyayers/django-tables2), currently depends on django-bootstrap-toolkit (https://github.com/dyve/django-bootstrap-toolkit)
.table-container th.asc:after {
content: '\0000a0\0025b2';
}
.table-container th.desc:after {
content: '\0000a0\0025bc';
}
.pagination {
text-align: center;
}
@RichardStyles
RichardStyles / JsonResponse.php
Last active May 26, 2016 18:31
Middleware for PHP Slim framework 3.x to output JSON responses with the correct header. Probably a better way to do this then just simply interrogating the response body, but for a initial test sufficient for my needs.
<?php
/**
* Middleware to set correct header for JSON output.
* Very basic initial version, simply checks the body of the response to see if it is valid JSON.
* If response is not JSON then continues with default settings.
* If response is JSON then header is updated.
*
* @author Richard Styles
*/
namespace App\Middleware;
@tszpinda
tszpinda / examle.html
Last active July 26, 2016 15:52
wkhtmltopdf
<html>
<body>
Test: Random text
</body>
</html>
@jonotron
jonotron / singleton.js
Created November 29, 2012 04:33
marionette.application singleton pattern
// usage:
// var app = require('singleton');
define(function(require) {
var Marionette = require('backbone.marionette');
// static instance of a Marionette.Application
var app = null;
// singleton function
function getSingleton() {
@caleywoods
caleywoods / application.coffee
Created January 24, 2012 14:57
Backbone JS / Fullcalendar
$ ->
Event = Backbone.Model.extend()
Events = Backbone.Collection.extend({
Model: Event,
url : 'events'
})
EventsView = Backbone.View.extend({
initialize: ->
@sagar-ganatra
sagar-ganatra / WrapRenderFunction.js
Created January 25, 2013 05:52
Adding beforeRender and afterRender functions to a Backbone View Refer to the blog post http://www.sagarganatra.com/2013/01/adding-beforerender-and-afterrender-functions-to-backbone-view.html
(function () {
var TestView = Backbone.View.extend({
el: '#container',
initialize: function () {
console.log('Inside Init');
@on99
on99 / haha.go
Created April 20, 2016 16:21
prove that gin context.Query() already unescape the query
package main
import (
"log"
"net/url"
"github.com/gin-gonic/gin"
)
func main() {
@xerardoo
xerardoo / listusers.bash
Created January 11, 2018 17:54
List All Users on linux
#!/bin/bash
# Name: listusers.bash
# Purpose: List all normal user and system accounts in the system. Tested on RHEL / Debian Linux
# Author: Vivek Gite <www.cyberciti.biz>, under GPL v2.0+
# -----------------------------------------------------------------------------------
_l="/etc/login.defs"
_p="/etc/passwd"
## get mini UID limit ##
l=$(grep "^UID_MIN" $_l)
@moemoe89
moemoe89 / .gitlab-ci.yml
Created May 2, 2017 03:13
Example Gitlab CI Setup for Go-Lang
image: golang:1.8.1
variables:
BIN_NAME: go-practice-ci
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/go-practice-ci
stages:
- build
- test