Skip to content

Instantly share code, notes, and snippets.

@hotdoujiang
hotdoujiang / 2018GlobalTerror.csv
Last active December 30, 2020 19:42
1970-2019 Global Terrorism Dataset
We can't make this file beautiful and searchable because it's too large.
year,month,day,country,region,provstate,city,latitude,longitude,nkill,nwound,nwoundkill
2018,1,1,Iraq,Middle East & North Africa,Nineveh,Tal Afar,36.376825,42.448876,3,0,3
2018,1,1,Iraq,Middle East & North Africa,Kirkuk,Kirkuk,35.452112,44.375464,0,0,0
2018,1,1,Pakistan,South Asia,Balochistan,Chaman,30.92211,66.451533,0,2,2
2018,1,1,Pakistan,South Asia,Balochistan,Chaman,30.92211,66.451533,0,6,6
2018,1,1,Nigeria,Sub-Saharan Africa,Adamawa,Madagali,10.88942,13.62832,3,0,3
2018,1,1,Afghanistan,South Asia,Farah,Pusht Rod district,32.48035,62.028915,1,2,3
2018,1,1,Iraq,Middle East & North Africa,Al Anbar,Radhwaniyah,33.18168,44.23542,0,1,1
2018,1,1,Egypt,Middle East & North Africa,Giza,Giza,30.022924,31.185193,2,0,2
2018,1,1,Pakistan,South Asia,Punjab,Multan,30.174426,71.478867,0,1,1
@ankitsinghaniyaz
ankitsinghaniyaz / nginx_proxy.config
Created April 20, 2017 17:15
Elastic Beankstalk Nginx configuration to supports /assets and /packs
# This is to enable WS support. Credits: # https://gist.github.com/Bubelbub/0a942a0d51a3d329897d
# THIS WORKS! for running the example 5.0.0.beta1 chat app on a single instance Elastic beanstalk AWS instance
files:
"/etc/nginx/conf.d/websockets.conf" :
content: |
upstream backend {
server unix:///var/run/puma/my_app.sock;
}
@zosiu
zosiu / facebook_graph_api.rb
Last active January 10, 2017 16:23
Facebook Graph API w/ Koala
### app access token
graph = Koala::Facebook::OAuth.new APP_ID, APP_SECRET
graph.get_app_access_token # => APP_TOKEN
### create test users with permissions
test_users = Koala::Facebook::TestUsers.new app_id: APP_ID, secret: APP_SECRET
user = test_users.create true, 'email,user_birthday,user_posts', name: 'Bob'
# =>
# { "id" => USER_ID,
# "access_token" => USER_ACCESS_TOKEN,
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@lackac
lackac / 2_ways.md
Last active August 29, 2015 13:57
2 Ways to Decompose Fat ActiveRecord Models – budapest.rb 03/2014
anonymous
anonymous / gist:8712796
Created January 30, 2014 16:39
int dataPin = 2;
int clockPin = 3;
int csPin = 4;
byte chars[] = {
B00011000,
B00111100,
B01100110,
B11000011,
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@sheeley
sheeley / SessionsController.rb
Last active September 13, 2021 21:30
SAML Controller for Rails (used when POSTing data to IDP and decrypting on return)
class SessionsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: :saml
def new
request = Onelogin::Saml::Authrequest.new
settings = saml_settings
request_doc = request.create_authentication_xml_doc(settings)
request_str = request_doc.to_s #.force_encoding("UTF-8")
logger.debug request_str
@framallo
framallo / makefile
Last active June 8, 2023 07:49
This is a makefile to deploy a rails application using puma, runit and apache
# This is the deployment recipe
# You require to install runit on the server.
# First you need to declare on which port the application will run
#
# echo 3000 > port
#
# Then you can setup a new runit service with
#
# make setup_service
#