Skip to content

Instantly share code, notes, and snippets.

View danswater's full-sized avatar
🎯
Focusing

Francis Kennet Lamayo danswater

🎯
Focusing
View GitHub Profile
@danswater
danswater / api.md
Last active October 18, 2016 01:59
Saving widget settings

API:

<request-url>

Query:

chart_type          = pieChart || barGraph
interval            = daily || weekly || monthly
date_range = "2016-10-12,2016-10-12"
@danswater
danswater / homebrew_mysql_pass_reset.txt
Created September 22, 2016 06:46 — forked from fallwith/homebrew_mysql_pass_reset.txt
Reset MySQL root password (Homebrew)
$> launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
$> /usr/local/Cellar/mysql/5.5.9/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.9 --datadir=/usr/local/Cellar/mysql/5.5.9/data --plugin-dir=/usr/local/Cellar/mysql/5.5.9/lib/plugin --log-error=/usr/local/Cellar/mysql/5.5.9/data/errors.err --pid-file=/usr/local/Cellar/mysql/5.5.9/data/pidfile.pid --skip-grant-tables
$> mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('root_password') WHERE User='root';
mysql> FLUSH PRIVILEGES;
$> kill `cat /usr/local/Cellar/mysql/5.5.9/data/pidfile.pid`
[
{
"directive" : "weekly-timelog",
"name" : "Weekly Timelog",
},
{
"component" : "daily-timelog",
"name" : "Daily Timelog"
},
{
@danswater
danswater / issue.md
Last active July 7, 2016 05:28
Response structure inconsistency

In front-end side, our implementation when fetching a data from the server is that the response data structure should be consistent.

e.g when the response has data and in the form of an object structure

{
  "total": 22,
  "per_page": "1000",
  "current_page": 1,
  "last_page": 1,
 "next_page_url": null,
vm.gridOptions = [
{
'name' : 'jobName',
'displayName' : 'Job Name',
'grouping' : {
'groupPriority' : 1
},
'sort' : {
'priority' : 1,
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management
#include<stdio.h>
#include<string.h>
#define MAX 5
struct record {
char fname[ 20 ];
char lname[ 20 ];
char mname[ 20 ];
char bdate[ 30 ];
int mm;
@danswater
danswater / gulp.js
Created April 14, 2015 00:12
Linting JSX using gulp
return gulp
.src( sources )
.pipe( $.jshint( jshintrcFile ) )
.pipe( $.jshint( { 'linter' : require( 'jshint-jsx' ).JSXHINT } ) ) // you need to separetely install this module
.pipe( $.jshint.reporter( 'jshint-stylish', { 'verbose' : true } ) )
.pipe( $.jshint.reporter( 'fail' ) );
@danswater
danswater / timezone.cfc
Last active August 29, 2015 14:09
Timezone
<cfcomponent>
<cffunction name="conversion" returntype="any" access="remote" >
<cfargument name="localDate" type="string" required="true" >
<cfargument name="localTimeDiff" type="string" required="true">
<!--- assume the server is in utah --->
<cfset var utahTimeDiff = -7 >
<cfset var diff = utahTimeDiff + localTimeDiff >
<cfset var convertedDate = DateAdd( "h", diff, localDate ) >
@danswater
danswater / ng-snippets
Created October 4, 2014 20:10
Angular snippets
<!-- Place this file inside your 'Packages/User' folder -->
<snippet>
<content>
<![CDATA[9
( function ( angular ) {
'use strict';
} )( window.angular );
]]>
</content>