Skip to content

Instantly share code, notes, and snippets.

View grabbeh's full-sized avatar

grabbeh

  • UK
View GitHub Profile
@grabbeh
grabbeh / nytimes.json
Created October 12, 2018 16:19
NY times user object
{
"user": {
"isLoggedIn": true,
"type": "sub",
"regiId": 72156106,
"watSegs": "Cooking",
"nytdOtherData": {
"subscriptions": [
{
"bundle": "XPASS",
@grabbeh
grabbeh / query
Last active August 29, 2015 14:04
Elastic search queries
"query":{
"filtered": {
"query": {
"query_string": { "query": "Brazil" }
},
"filter": {
"term": { "entity": "Guinness World Records" }
}
}
}
@grabbeh
grabbeh / nginx.conf
Last active August 29, 2015 14:04
Nginx.conf
user nginx nginx
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
Backtrace:
0: /usr/bin/X (xorg_backtrace+0x26) [0x7fd682374a86]
1: /usr/bin/X (0x7fd6821ec000+0x767b1) [0x7fd6822627b1]
2: /usr/bin/X (0x7fd6821ec000+0x11c42b) [0x7fd68230842b]
3: /usr/bin/X (0x7fd6821ec000+0x11bdc5) [0x7fd682307dc5]
4: /usr/bin/X (0x7fd6821ec000+0x11f143) [0x7fd68230b143]
5: /usr/bin/X (0x7fd6821ec000+0x14278a) [0x7fd68232e78a]
6: /usr/bin/X (mieqProcessDeviceEvent+0x204) [0x7fd6823555d4]
7: /usr/bin/X (mieqProcessInputEvents+0x84) [0x7fd682355664]
8: /usr/bin/X (ProcessInputEvents+0x9) [0x7fd682276fc9]
@grabbeh
grabbeh / gist:219c496559a17e3c9d3a
Created May 26, 2014 10:34
.Xmodmap key bindings
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam
keycode 11 = 2 quotedbl 2 quotedbl
keycode 12 = 3 numbersign 3 numbersign
keycode 13 = 4 dollar 4 dollar
keycode 14 = 5 percent 5 percent
keycode 15 = 6 asciicircum 6 asciicircum
keycode 16 = 7 ampersand 7 ampersand
keycode 17 = 8 asterisk 8 asterisk
@grabbeh
grabbeh / trademarkchecker.js
Last active August 29, 2015 14:00
Trade mark & geojson sorting functions
// routes/main.js
exports.getRangeOfGeoJsonForAllYears = function(req, res){
helper.getPortfolioSortedByFilingYear(function(obj){
helper.convertYearPortfolioAndSupplementLiveGeoJSON(obj, function(o){
res.json(o);
})
})
}
@grabbeh
grabbeh / gist:8349457
Created January 10, 2014 10:08
Licence

End User Licence Agreement

Following purchase of [Project name] you can use the code in any manner you choose, including modifying any part of the code, with the following exception. Although you are free to incorporate [Project name] into commercial projects for third parties, you may not distribute, sub-licence or re-distribute [Project name] or any modified version of [Project name] in a standalone form to third parties.

@grabbeh
grabbeh / code.js
Last active January 2, 2016 14:08
Inconsistency with manipulation of dummy data vs db data
// app.js
routes = require('./routes/routes.js')
app.get('/dummydata', routes.test);
app.get('/transformeddummydata', routes.testTwo);
app.get('/dbdata', routes.testThree);
[{"name":"Afghanistan","alpha-2":"AF","alpha-3":"AFG","country-code":"004","iso_3166-2":"ISO 3166-2:AF","region-code":"142","sub-region-code":"034"},{"name":"Ã…land Islands","alpha-2":"AX","alpha-3":"ALA","country-code":"248","iso_3166-2":"ISO 3166-2:AX","region-code":"150","sub-region-code":"154"},{"name":"Albania","alpha-2":"AL","alpha-3":"ALB","country-code":"008","iso_3166-2":"ISO 3166-2:AL","region-code":"150","sub-region-code":"039"},{"name":"Algeria","alpha-2":"DZ","alpha-3":"DZA","country-code":"012","iso_3166-2":"ISO 3166-2:DZ","region-code":"002","sub-region-code":"015"},{"name":"American Samoa","alpha-2":"AS","alpha-3":"ASM","country-code":"016","iso_3166-2":"ISO 3166-2:AS","region-code":"009","sub-region-code":"061"},{"name":"Andorra","alpha-2":"AD","alpha-3":"AND","country-code":"020","iso_3166-2":"ISO 3166-2:AD","region-code":"150","sub-region-code":"039"},{"name":"Angola","alpha-2":"AO","alpha-3":"AGO","country-code":"024","iso_3166-2":"ISO 3166-2:AO","region-code":"002","sub-region-code":"017"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.