Skip to content

Instantly share code, notes, and snippets.

View carlesandres's full-sized avatar

Carles Andrés carlesandres

View GitHub Profile
@carlesandres
carlesandres / ConsumingComponent.js
Last active November 3, 2021 10:41
LaunchDarkly React example
import { withLDConsumer } from 'launchdarkly-react-client-sdk';
const ConsumingComponent = (props) => {
// A `flags` object has been added to the `props`, which is updated with the value of the flags for the currently identified user
// An `ldClient` prop is also added which can be used to interact with Launchdarkly's client side SDK
const { flags, ldClient } = props;
// ldClient needs to be used to identify the user
@carlesandres
carlesandres / 0_reuse_code.js
Created September 25, 2015 16:36
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function currencyFormat(n, lang) {

AngularJS BootStrap 3 Modal Dialogs

A dialog/modal service written in AngularJS, creates predefined easy to use dialogs (error,wait,notify,confirm,create) with Angular UI and Bootstrap 3

A Pen by Michael E Conroy on CodePen.

License.

My Vim shortcuts

,y Paste things copied before ,ss Search Ultisnips ,sl Search in current buffer with unite ,sw Search word under cursor (unite) ,m List my marks (unite) ma, mb ,... Set file-wide marks mA, mB,... Set project wide marks 'a, 'b, 'A Jump to mark ,V Open VimShell

@carlesandres
carlesandres / convert.pl
Created June 8, 2013 23:44
Perl sqlite to mysql conversion
#! /usr/bin/perl
while ($line = <>){
if (($line !~ /BEGIN TRANSACTION/) && ($line !~ /COMMIT/) && ($line !~ /sqlite_sequence/) && ($line !~ /CREATE UNIQUE INDEX/)){
if ($line =~ /CREATE TABLE \"([a-z_]*)\"(.*)/){
$name = $1;
$sub = $2;
$sub =~ s/\"//g;
$line = "DROP TABLE IF EXISTS $name;\nCREATE TABLE IF NOT EXISTS $name$sub\n";
@carlesandres
carlesandres / Gruntfile.js
Last active December 15, 2015 10:59
Testing Gruntfile configurations for using PHP with Yeoman
'use strict';
//var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
//var mountFolder = function (connect, dir) {
// return connect.static(require('path').resolve(dir));
//};
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@carlesandres
carlesandres / dabblet.css
Created October 24, 2012 16:46
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background-color:#269;
background-image: linear-gradient(white 2px, transparent 2px),
linear-gradient(90deg, white 2px, transparent 2px),
linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);
background-size:100px 100px, 100px 100px, 20px 20px, 20px 20px;
@carlesandres
carlesandres / dabblet.css
Created October 18, 2012 16:53
sinbutton
/* sinbutton */
.sinbutton {
background: black;
background-image: -webkit-linear-gradient(top, #333, #666);
color: white;
font-size: 14px;
margin: 5px;
padding: 3px;
border-radius: 3px;
@carlesandres
carlesandres / dabblet.css
Created October 18, 2012 15:04
sinbutton
/* sinbutton */
.sinbutton {
background: black;
background-image: -webkit-linear-gradient(top, #333, #666);
color: white;
font-size: 14px;
margin: 5px;
padding: 3px;
border-radius: 3px;