- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
👷♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| // fibonacci is a function that returns | |
| // a function that returns an int. | |
| func fibonacci() func() int { | |
| prev, next, res := 0, 0, 0 | |
| return func() int { | |
| res = prev + next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "golang.org/x/tour/wc" | |
| "strings" | |
| ) | |
| func WordCount(s string) map[string]int { | |
| var r = make(map[string]int) | |
| for _, w := range strings.Fields(s) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| z, prev := x/2, x | |
| for math.Abs(prev - z) >= 1e-14 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "golang.org/x/tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| var pxy = make([][]uint8, dy) | |
| // allocation | |
| for yi := range pxy { | |
| pxy[yi] = make([]uint8, dx) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT vtiger_crmentity.label, vtiger_crmentity.crmid, vtiger_crmentity.setype, vtiger_crmentity.createdtime | |
| FROM vtiger_crmentity | |
| LEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_crmentity.crmid | |
| LEFT OUTER JOIN vtiger_leadaddress ON vtiger_leadaddress.leadaddressid = vtiger_crmentity.crmid | |
| LEFT OUTER JOIN vtiger_contactsubdetails ON vtiger_contactsubdetails.contactsubscriptionid = vtiger_crmentity.crmid | |
| LEFT OUTER JOIN vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_crmentity.crmid | |
| WHERE | |
| ( | |
| vtiger_crmentity.label LIKE '%test@%' | |
| OR vtiger_contactsubdetails.homephone LIKE '%test@%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mike@rbci:~$ psql -U postgres | |
| psql (9.0.3) | |
| Type "help" for help. | |
| postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
| UPDATE 1 | |
| postgres=# \c template0 | |
| You are now connected to database "template0". | |
| template0=# update pg_database set datistemplate = FALSE where datname = 'template1'; | |
| UPDATE 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require.config({ | |
| baseUrl: '/backbone-tests/', | |
| paths: { | |
| 'jquery' : '/app/libs/jquery', | |
| 'underscore' : '/app/libs/underscore', | |
| 'backbone' : '/app/libs/backbone', | |
| 'mocha' : 'libs/mocha', | |
| 'chai' : 'libs/chai', | |
| 'chai-jquery' : 'libs/chai-jquery', | |
| 'models' : '/app/models' |
I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:
- the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
- set the service for
oauth_user_providerin thesecurity.ymlwith your custom created service
Here are the steps:
- Routing. In
routing.ymlI have added all the routes for both bundles. - Configuration. I have set the
config.ymlmostly as it is presented in the HWIOAuthBundle. - Security. I have set the
security.ymlmostly as it is presented in the HWIOAuthBundle (though my routes are using/loginpattern, not/connect). Also, theoauth_user_provideris set for my custom service.