Skip to content

Instantly share code, notes, and snippets.

View apisandipas's full-sized avatar

Bryan Paronto apisandipas

View GitHub Profile
@apisandipas
apisandipas / filmstrip.css
Created May 7, 2019 01:16 — forked from amy-langley/filmstrip.css
Filmstrip React component
.filmstrip{
padding: 0;
margin: 10px;
display: flex;
}
.navButton{
border: 0;
margin: 0;
height: 100%;
@apisandipas
apisandipas / pretty-print-json.erb
Created August 29, 2018 15:02
Rails JSON pretty print
<pre>
<%= JSON.pretty_generate(@subject) %>
<%= JSON.pretty_generate(@notification.attributes[:action_attributes][:message]) %>
</pre>
@apisandipas
apisandipas / docker-compose.yml
Created May 11, 2018 19:28
Simple WordPress setup
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
ports:
- "3306:3306"
@apisandipas
apisandipas / share-urls.md
Last active August 3, 2025 16:23 — forked from chrisl8888/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@apisandipas
apisandipas / console_log.php
Created May 13, 2016 18:51
Better error_log debugging
function console_log($obj) {
ob_start();
var_dump($obj);
$contents = ob_get_contents();
ob_end_clean();
error_log($contents);
}
@apisandipas
apisandipas / responseHelpers.mddleware.js
Created September 12, 2015 16:46
Express Response Helpers
'use strict';
/**
* Map of HTTP Status codes.
*/
var Status = {
OK: 200,
BAD_REQUEST: 400,
UNAUTHORIZED: 401,
NOT_FOUND: 404,
@apisandipas
apisandipas / gist:f85aa6e3a4107125e114
Last active August 29, 2015 14:25
ListGroupBy.jsx
var React = require('react');
var _ = require('underscore');
// Component Props
// data - the array of objects
// groupBy - the propert by which to group the objects
// itemComponent (optional) - component to render for each list Item
// headerComponent (optional) - component to render for Group header
// Example
@apisandipas
apisandipas / baseStore.js
Last active August 29, 2015 14:24
'backflux'
var Backbone = require('backbone');
var Dispatcher = require('./dispatcher');
var BaseStore = {
/**
* backbone init method
* - the Dispatcher registers this stores handleDispatch method and return a reference to self, the dispatchId.
*/
initialize: function() {
@apisandipas
apisandipas / json
Created July 7, 2015 04:20
Raw Station Data with nested shows (called airings here)
{
"stationId": "20569",
"callSign": "TWCNAT",
"channel": "001",
"preferredImage": {
"uri": "sources/generic/generic_sources_h3.png"
},
"airings": [{
"startTime": "2015-07-06T19:00Z",
"endTime": "2015-07-06T19:30Z",
@apisandipas
apisandipas / postalCodeToTimezone
Created July 2, 2015 01:38
Guess timezone given a Canadian postal code.
/**
* Maps a Canada postal code to a (marginal) guess at your Timezone.
* @type {Object}
*/
var data = {
'America/Chicago': [
'S', 'R', 'X0C'
],
'America/New_York': [
'J', 'G', 'H', 'L', 'K', 'M', 'N', 'X0A'