Skip to content

Instantly share code, notes, and snippets.

View xsaamiir's full-sized avatar
🟡
xoē

sāmīr xsaamiir

🟡
xoē
View GitHub Profile
@tdd
tdd / gitconfig.ini
Last active April 17, 2024 10:04
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@evandrix
evandrix / pep20_by_example.py
Created March 13, 2012 18:45
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 26, 2024 05:00
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@idleberg
idleberg / fish_shell.md
Last active June 11, 2024 00:49
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish
@bonzanini
bonzanini / create_index.sh
Last active May 25, 2023 23:35
Elasticsearch/Python test
curl -XPOST http://localhost:9200/test/articles/1 -d '{
"content": "The quick brown fox"
}'
curl -XPOST http://localhost:9200/test/articles/2 -d '{
"content": "What does the fox say?"
}'
curl -XPOST http://localhost:9200/test/articles/3 -d '{
"content": "The quick brown fox jumped over the lazy dog"
}'
curl -XPOST http://localhost:9200/test/articles/4 -d '{
@matanox
matanox / Slick 3.0.0 code generation
Last active April 13, 2018 17:12
SBT task for slick code generation from a live database
//
// SBT task for slick code generation for a live database
// ======================================================
//
// This sbt task will generate slick scala classes to match your (MySQL) database schema,
// which will allow you to use the database through slick, in your scala application.
//
// Usage: Review all ? symbols and comments below, to adapt to your system. Embed in build.sbt.
// Make sure the database is up. Run: sbt slickGenerate
// In your scala application, import the resulting scala file
@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
package services
import java.security.Security
import org.slf4j.LoggerFactory
object DnsCache {
private val logger = LoggerFactory.getLogger("DnsCache")
{
"fantasy-name": "Restaurant fantasy name",
"company name": "Restaurant company name",
"logo": "Restaurant logo",
"CNPJ": "Restaurant CNPJ",
"phone": "Restaurant phone",
"telephone": "Restaurant telephone",
"website": "Restaurant website",
"category": [
"Fast Food",
#!/bin/bash
echo "removing evaluation key"
rm ~/.IntelliJIdea2017.3/config/eval/idea173.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea2017.3/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml