- An internet connection!
- Terminus DB copy (data-sql-apr-15.sql.bz2)
- Solr copy (data-solr-apr-15.sql.bz2)
- Maven 3
- Recommended: NVM to install node & npm
- Node v4
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
| curl -X POST -H "Content-Type: application/json" -d '{ <<< | |
| "setting_type":"call_to_actions", | |
| "thread_state":"new_thread", | |
| "call_to_actions":[ | |
| { | |
| "payload":"START_MESSENGER" | |
| } | |
| ] | |
| }' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=${accessToken}" |
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
| curl -X POST -H "Content-Type: application/json" -d '{ | |
| "setting_type":"greeting", | |
| "greeting":{ | |
| "text":"Bienvenido a ExpansionMX" | |
| } | |
| }' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=${ACCESS_TOKEN}" | |
| curl -X DELETE -H "Content-Type: application/json" -d '{ <<< | |
| "setting_type":"greeting" |
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 to_date(to_char(current_timestamp AT TIME ZONE 'America/Mexico_City', 'YYYY-MM-dd'), 'YYY-MM-DD')::timestamp AT TIME ZONE 'America/Mexico_City'; |
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
| var http = require('http'), | |
| httpProxy = require('http-proxy'), | |
| tamper = require('tamper'); | |
| var host = 'localhost:4242'; | |
| var proxy = httpProxy.createProxyServer({target:'https://' + host}); | |
| var crossdomain = '<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="all"/> <allow-access-from domain="*" secure="false"/> <allow-http-request-headers-from domain="*" headers="*" secure="false"/> </cross-domain-policy>'; | |
| var clientaccesspolicy = '<?xml version="1.0" encoding="utf-8"?> <access-policy> <cross-domain-access> <!-- Silverlight 3 or higher requires the http-request-headers attribute. --> <policy> <allow-from http-request-headers="*"> <domain uri="http://*" /> <domain uri="https://*" /> </allow-from> <grant-to> <resource path="/" include-subpaths="true"/> </grant-to> </policy> </cross-domain-access> </access-policy>'; | |
| var t = tamper(function(req, res) { |
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
| #Based on http://techhari.blogspot.co.at/2013/05/elasticseach-routing-for-parent-child.html | |
| #Create a new parentchild index | |
| curl -XDELETE 'http://localhost:9200/parentchild' && echo | |
| curl -XPUT 'http://localhost:9200/parentchild' -d '{}' && echo | |
| #Create mapping without routing | |
| curl -XPUT localhost:9200/parentchild/attrvalues/_mapping -d '{ | |
| "attrvalues": { |
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
| # wget https://github.com/…/bo…/releases/download/2.0.0-rc8/boot.sh && mv boot.sh boot && chmod a+x boot && sudo mv boot /usr/local/bin | |
| # boot repl | |
| boot.user> (defn <3 [love & loves] (apply str love " <3 " (clojure.string/join " and " loves))) | |
| boot.user> (<3 "I" "Clojure" "you") | |
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
| import javax.ws.rs.Consumes | |
| import javax.ws.rs.POST | |
| import javax.ws.rs.core.MediaType | |
| import org.glassfish.jersey.media.multipart.FormDataContentDisposition | |
| import org.glassfish.jersey.media.multipart.FormDataParam | |
| @POST | |
| @Consumes(MediaType.MULTIPART_FORM_DATA) |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am iamedu on github. | |
| * I am iamedu (https://keybase.io/iamedu) on keybase. | |
| * I have a public key whose fingerprint is 529F 8101 A1E9 684D F828 6F9A 4AB8 268D F41D 083A | |
| To claim this, I am signing this object: |
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
| import java.security.* | |
| class PhoneHasherService { | |
| String checkHashPhone(String phone, String hash) { | |
| int iterations = 128 | |
| String [] hashParts = hash.split(":") | |
NewerOlder