This file contains 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
curl -H "Origin: http://localhost:8080" \ | |
-H "Access-Control-Request-Method: POST" \ | |
-H "Access-Control-Request-Headers: X-Requested-With" \ | |
-X OPTIONS --verbose \ | |
http://localhost:8080/my/api | |
# ... | |
# < Access-Control-Allow-Origin: * | |
# < Access-Control-Allow-Methods: POST | |
# < Access-Control-Allow-Headers: X-Requested-With |
This file contains 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
# install dep | |
npm i -g detect-file-encoding-and-language | |
# one file | |
dfeal myfile.txt | |
# file in folder | |
find ./myfolder -maxdepth 1 -type f -printf '%p' -exec dfeal {} \; | |
# recursive |
This file contains 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
logging.level.org.hibernate.SQL=debug | |
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=trace | |
logging.level.org.springframework.orm.jpa.JpaTransactionManager=debug |
This file contains 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 com.innovatm.database; | |
// ... | |
@Component | |
public class NativeQuery { | |
@Autowired | |
private JpaTransactionManager jpaTransactionManager; | |
This file contains 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
import { parse } from 'path'; | |
/** | |
* Search it() calls and replace with test() in .spec.js files | |
* | |
* Run with: jscodeshift -t itToTestTransform.js lib | |
*/ | |
module.exports = function (file, api) { | |
const j = api.jscodeshift; |
This file contains 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
import { parse } from 'path'; | |
/** | |
* Search for | |
* | |
* import ... from 'mydependency'; | |
* | |
* And replace with a relative import: | |
* | |
* import ... from '.../mydependency'; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#map { | |
height: 430px; | |
position: relative; | |
width: 100%; | |
} | |
.maps-frame { |
This file contains 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
var mongoose = require('mongoose'); | |
var hitSchema = mongoose.Schema({ | |
text: String, | |
music: String | |
}); | |
hitSchema.statics.bulkInsert = function(models, fn) { | |
if (!models || !models.length) | |
return fn(null); |
This file contains 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
# The SPF record should be present as TXT to be able to be read by Mailgun, and optionnaly as SPF. | |
# To do that you need to edit the zone as "expert" cause Gandi IHM refuses to create a second TXT | |
# record for "@" (it can occurs if you have a Google Webmaster tool verification DNS record) | |
email 10800 IN CNAME mailgun.org. | |
krs._domainkey 10800 IN TXT "k=rsa; p=MIG...QAB" | |
@ 10800 IN SPF "v=spf1 include:mailgun.org ~all" | |
@ 10800 IN TXT "v=spf1 include:mailgun.org ~all" | |
@ 10800 IN TXT "google-site-verification=Gy0...xrY" |
This file contains 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
# https://academy.appgyver.com/installwizard/steps#/install-nvm | |
# as regular user (not root) | |
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh | |
nvm install 0.10 | |
nvm use 0.10 | |
nvm alias default 0.10 | |
node -v |
NewerOlder