Skip to content

Instantly share code, notes, and snippets.

View hackerzhut's full-sized avatar

Sara hackerzhut

View GitHub Profile
@hackerzhut
hackerzhut / es.js
Last active June 6, 2018 06:58
Unallocated shard error
{
"index" : "82656-2018-04-11-br-11-vic.avro",
"shard" : 1,
"primary" : false,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "REPLICA_ADDED",
"at" : "2018-06-06T06:48:10.483Z",
"last_allocation_status" : "no_attempt"
},
@hackerzhut
hackerzhut / config.json
Last active August 22, 2018 04:49
VSCode Config
{
"editor.fontFamily": "FiraCode-Light, OperatorMono-Light, Menlo, Monaco, monospace",
// Controls the font size in pixels.
"editor.fontSize": 15,
"workbench.colorTheme": "Atom One Dark",
"editor.lineHeight": 28,
// "window.zoomLevel": 0.25,
@hackerzhut
hackerzhut / color-log.js
Last active March 28, 2018 05:52
Color Log using Proxy
(() => {
const log = new Proxy({}, {
get: (_, color) => (...args) => console.log(`%c ${args.join(' ')}`, `color: ${color}`)
});
log.tomato('I am tomato')
log.chocolate('I am chocolate')
log.cornflowerblue('I am cornflowerblue')
log.darkcyan('I am darkcyan')
@hackerzhut
hackerzhut / Dockerfile
Created March 28, 2018 04:53 — forked from profjsb/Dockerfile
Refreshing Materialized Views in Postgres using Docker
# Dockerfile to run the cron jobs in root, including python/psycopg2
FROM alpine:edge
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing py-psycopg2
EXPOSE 6000
COPY refresh.py /refresh.py
COPY root /var/spool/cron/crontabs/root
CMD crond -l 2 -f
@hackerzhut
hackerzhut / README.md
Created September 30, 2017 11:11 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@hackerzhut
hackerzhut / nginxproxy.md
Created February 24, 2016 05:40 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@hackerzhut
hackerzhut / 0_reuse_code.js
Created January 11, 2016 00:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hackerzhut
hackerzhut / index.md
Last active August 29, 2015 14:11 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@hackerzhut
hackerzhut / gist:0edfab8ad2c2563cb588
Created November 23, 2014 04:37
Stanford NLP Output
{
"annotations": [
{
"annotation": "This is the shit",
"coreMaps": [
{
"sentence": "This is the shit",
"tree": {
"0": {
"value": [
@hackerzhut
hackerzhut / README.md
Last active August 29, 2015 14:06 — forked from rantav/README.md

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...