Skip to content

Instantly share code, notes, and snippets.

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@djabif
djabif / slugify.pipe.ts
Last active June 28, 2024 21:59
Angular Pipe to transform a string into a slug
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'slugify'})
export class SlugifyPipe implements PipeTransform {
transform(input: string): string {
return input.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import {environment} from "../../environments/environment";
/** Encryption Stuff **/
var CryptoJS = require("crypto-js");
var hmacsha1 = require('hmacsha1');
@nolanlawson
nolanlawson / windows.md
Last active December 28, 2018 22:24
Git/Bash/Node/npm on Windows

Git/Bash/Node/npm on Windows

Update: there's an easier way to do this. Check out my new gist instead.

How I set up my Windows 10 machine for Node development. Time to complete: about 2 hours on a fast connection.

Requirements

  • Bash, not Windows shell
@enpe
enpe / CMakeLists.txt
Last active November 25, 2022 04:15
OpenCV chroma key
cmake_minimum_required( VERSION 3.0 )
project( so-opencv-calibration )
find_package( OpenCV 3.0.0 EXACT REQUIRED )
set( INPUT_FILENAME "${CMAKE_CURRENT_LIST_DIR}/input_00.png" ) # Input file, e.g. http://i.stack.imgur.com/WjER0.png
add_executable( mwe mwe.cpp )
target_compile_definitions( mwe PRIVATE -DINPUT_FILENAME="${INPUT_FILENAME}" )
target_include_directories( mwe PRIVATE ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( mwe ${OpenCV_LIBS} )
@grorg
grorg / Emoji.plist
Last active March 22, 2021 18:38
Use text substitution to make typing emoji easy on OS X.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
Text expansion shortcuts for a bunch of emoji.
e.g. ";poo" -> 💩
Not all emoji are included, but I tried to come up with obvious names. There
are also a few in-jokes, sorry.
Cheat sheet: https://gist.github.com/grorg/4773372
@JeffreyWay
JeffreyWay / presentationPrep.js
Created April 6, 2012 22:11
I wish it could be that simple. Something for me to build.
presentation
.title('My Great Presentation')
.slide({
title: 'Learn About Borders',
bullets: [
'Thing 1',
'Thing 2',
],
code: ['path/to/file.css', [2,4]] // path to file, lines to grab
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@ryanwood
ryanwood / postgresql.rb
Created December 30, 2011 14:54
Postgres 8.4.6 Homebrew forumula
require 'formula'
require 'hardware'
class Postgresql < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.6/postgresql-8.4.6.tar.bz2'
md5 'fcc3daaf2292fa6bf1185ec45e512db6'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old