Skip to content

Instantly share code, notes, and snippets.

View skyrpex's full-sized avatar
👋

Cristian Pallarés skyrpex

👋
View GitHub Profile
@chriskjaer
chriskjaer / circle.yml
Last active March 22, 2017 22:29
Use Yarn on CircleCI with cache
machine:
pre:
- mkdir ~/.yarn-cache
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
cache_directories:
- ~/.yarn-cache
override:
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Dhertz
Dhertz / Ubuntu_Aerial.md
Last active March 28, 2023 02:06
Quick overview of how to get Apple's new TV screensavers working on most linux systems.

Using Apple’s Aerial Screensavers on Ubuntu After coming across the [Aerial] (https://github.com/JohnCoates/Aerial) screensavers for Mac, and installing them, I decided that I had had enough of the graphics-demos of my Ubuntu Precise system. I hope to provide a simple guide on how to add them to your setup as well.

First, you need to install xscreensaver (for example with aptitude, but your distro should have it):

sudo aptitude install xscreensaver
@alecthomas
alecthomas / entityx_tx2.cc
Last active May 17, 2016 10:26
Parallel EntityX prototype
#include <utility>
#include <thread>
#include <limits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <cstdint>
#include <iostream>
#include <mutex>
#include <future>
@alecthomas
alecthomas / log.cc
Last active May 17, 2016 10:26
Simple, type and thread safe C++11 console logging function
#include <iostream>
#include <mutex>
std::recursive_mutex log_lock;
// If you have ever tried using cerr/cout from multiple threads you may have experienced
// character interleaving. These functions avoid that.
template <typename A>
void log(const A &arg) {
log_lock.lock();
function parseQueryString(qs) {
qs = qs.replace(/\+/g, ' ');
var params = {}, tokens,
re = /[?&]:?([^=]+)=([^&#]*)/g;
while (tokens = re.exec(qs)) {
// console.log(tokens);
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
@jhermann
jhermann / git-commit-emojis.md
Last active September 23, 2023 07:09
Useful emoji for git commit messages

Useful emoji for git commit messages

If you add emoji to your commit messages for a GitHub repo, they become less boring, and you can convey the kind of change you're adding. See the full set of GitHub supported emoji here (also useful for easy copy&paste via a simple click).

Example commit message

The following is a possible scheme to use:

@Arty2
Arty2 / jquery.draggable.js
Last active November 26, 2020 12:28
jQuery plugin to make elements draggable without jQuery UI. Usage: view source on http://jqueryui.com/draggable/
/*--------------------------------------------------------------
Draggable
alternative to jQuery UI’s draggable
based on comments from: http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
usage example: $('.post-thumbnail, article header').draggable();
--------------------------------------------------------------*/
(function($) {
if (!jQuery().draggable) {
$.fn.draggable = function() {
this
@berngp
berngp / .gitconfig
Created March 30, 2014 05:27
dot.gitconfig
[user]
name = Your Name
email = your.name@mail.com
[color]
ui = true
[core]
excludesfile = ~/.gitignore_global
editor = /usr/local/bin/mvim -f
@dannycroft
dannycroft / chunk.lodash.js
Created November 25, 2013 19:28
Lodash / Underscore method for breaking data sets into smaller sets (chunks)
/**
* Lodash / Underscore method for breaking data sets into smaller sets (chunks)
*
* @arguments
*
* collection: Array / Object
* chuckSize: Number
*
* @example
*