Skip to content

Instantly share code, notes, and snippets.

@scottmcarthur
scottmcarthur / app.ts
Last active August 15, 2019 12:39
How to use AngularJS ng.resource.IResource with TypeScript.
/// <reference path="angular.d.ts" />
/// <reference path="angular-resource.d.ts" />
interface IEmployee extends ng.resource.IResource<IEmployee>
{
id: number;
firstName : string;
lastName : string;
}
interface IEmployeeResource extends ng.resource.IResourceClass<IEmployee>
@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@kimus
kimus / cx_oracle.md
Last active April 28, 2024 10:54
Installing python cx_oracle on Ubuntu

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 30, 2024 14:11
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@lpf23
lpf23 / CNTLM Proxy - Centos
Last active May 11, 2022 08:29
Configure CNTLM Proxy on Centos/Ubuntu
1) Download cntlm rpm package from http://sourceforge.net/projects/cntlm/files/cntlm/
2) Login as root
3) Run command:
$ rpm -ivh cntlm-*.rpm
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration)
$ cntlm -H -d <domain> -u <username>
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@celeryclub
celeryclub / Setting up headless Raspberry Pi OS on macOS.md
Last active April 12, 2024 06:31
Setting up headless Raspberry Pi OS on macOS

Download the latest Raspberry Pi OS Lite image from https://www.raspberrypi.com/software/operating-systems/ (2022-04-04 at the time of this writing).

Insert your microSD card. Use Raspberry Pi Imager to burn the image to your microSD card. Make to select "Set username and password" in the config before starting. Name the user pi and select your own password.

Ensure the disk is mounted again, then enable SSH.

$ touch /Volumes/boot/ssh
@mattcanty
mattcanty / .gitconfig
Last active September 23, 2016 11:23
Git 'Standup' Alias
[alias]
aa = add .
s = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -10
co = checkout
cob = checkout -b
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed
@michelsalib
michelsalib / deprecated.ts
Created April 23, 2015 13:17
Typescript @deprecated annotation
class Dog {
@deprecated('Dogs don\'t roar, they talk.')
roar() {
console.log('RRRRR');
}
@deprecated()
smile() {
console.log('smile');
}
@zchee
zchee / actionlist.vim
Last active April 19, 2024 13:22
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>