Skip to content

Instantly share code, notes, and snippets.

@ibraheem4
ibraheem4 / postgres-brew.md
Last active April 25, 2024 08:55 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@gengue
gengue / serializers.py
Last active February 2, 2023 03:50
Django Rest Framework user endpoint with change password
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import serializers
from .models import User
class UserSerializer(serializers.ModelSerializer):
"""
User accounts serializer
@nepsilon
nepsilon / fuzzy-search-postgres.md
Last active December 13, 2023 14:16
PostgreSQL: Native fuzzy search with levenshtein() — First published in fullweb.io issue #41

PostgreSQL: Fuzzy search with levenshtein()

Ever wanted to implement a “Did you mean?” feature in your search results? Google is said to have greatly increased its user engagement with it. Here is how to implement it simply in Postgres (v9.1+):

Install the extension:

CREATE EXTENSION fuzzystrmatch;
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 23, 2024 06:15
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@boneskull
boneskull / bbb.yml
Last active June 3, 2021 11:26
Ansible Playbook for Configuring BeagleBone Black on Debian (wheezy) from MacOS X 10.10.x w/ setup for Edimax EW-7811Un
# CHANGELOG
# 3/22/15:
# - updated keyring
#
# To setup ansible on Mac:
# brew install ansible
# mkdir -p /usr/local/etc/ansible
# mkdir -p /usr/local/share/ansible
#
# To run:
@juanpasolano
juanpasolano / api models Locations.js
Created September 9, 2014 21:50
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 24, 2024 11:43
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@DarwinAwardWinner
DarwinAwardWinner / .home-rsync-filter
Created April 29, 2011 08:12
Example rsync filter file for excluding temp files and stuff
## Rsync Filter for $HOME
# Universal excludes -- These apply to all subdirs
- [Cc]ache
- temp
- tmp
- octave-core
# Emacs temp files
- .#*
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh