Skip to content

Instantly share code, notes, and snippets.

@EpokK
EpokK / ngPlaceholder.js
Last active December 19, 2015 02:38
Placeholder directive : ngPlaceholder (https://twitter.com/ririlepanda)
app.directive('ngPlaceholder', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attr, ctrl) {
var value;
var placehold = function () {
element.val(attr.placehold)
@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
@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>
@eliangcs
eliangcs / http-prompt-story.md
Last active June 3, 2020 06:49
How I created HTTP Prompt and got 5000+ stars on GitHub

How I Created HTTP Prompt and Got 5000+ Stars on GitHub

Two months ago, I published an open source project, which went viral by gaining 1200+ stars in the first 24 hours. As of this writing, it has attracted 5000+ stars. The project is called HTTP Prompt:

https://github.com/eliangcs/http-prompt

Here I want to share its development story.

It all began with Vertica. Not long ago, I used Vertica every day for my work. Vertica is a powerful database, but the official client (vsql) is not powerful at all. The GUI alternative, DbVisualizer, is bad as well.

@emilio
emilio / notification.js
Last active September 24, 2020 07:44
window.Notification polyfill
/*
* window.Notification polyfill
* @author Emilio Cobos (http://emiliocobos.net)
*/
/* try prefixed */
if( ! window.Notification ) {
window.Notification = (function() {
return window.Notification || window.webkitNotification || window.mozNotification || window.oNotification || window.msNotification;
})()
@dameninngenn
dameninngenn / git_log_sum_ex
Created August 16, 2011 10:49
git log sum example
% git log --stat --author=dameninngenn --since="2011-07-15" --before="2011-08-15" --no-merges | grep 'files changed' | awk '{ins += $4}{del += $6} END{print "total: "ins"insertions(+) "del"deletions(-)"}'
> total: 3385insertions(+) 1089deletions(-)
@solancer
solancer / Install Ruby Gems on Mac OS X without sudo
Created January 3, 2017 15:21
Install Ruby Gems on Mac OS X without sudo
Install Ruby Gems on Mac OS X without sudo
1. Add GEM_HOME to your .bash_profile
For example, nano ~/.bash_profile and add
export GEM_HOME=/Users/srinivas/.gem where the path is to your own Home folder
2. Add the gem executables to your system path
Also in .bash_profile, add
@ripla
ripla / RestConfiguration.java
Last active May 31, 2021 06:39
The different ways of accessing a REST HATEOAS resource created with Spring Data. Using a Spring RestTemplate.
import java.util.Arrays;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.hal.Jackson2HalModule;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
@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>
@sinistersnare
sinistersnare / Drop.java
Last active May 17, 2022 15:32
This is the gist for the "Extended Simple App" LibGDX tutorial found at: https://libgdx.com/dev/simple_game_extended/
package com.badlogic.drop;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class Drop extends Game {
SpriteBatch batch;
BitmapFont font;