Skip to content

Instantly share code, notes, and snippets.

View floydpink's full-sized avatar

Hari Pachuveetil floydpink

View GitHub Profile
@jdanyow
jdanyow / app.html
Last active November 29, 2017 01:39
Google reCAPTCHA with Aurelia
<template>
<require from="./recaptcha"></require>
<form action="?" method="POST">
<recaptcha theme="light" verified.call="onVerified($event)"></recaptcha>
<recaptcha theme="dark" verified.call="onVerified($event)"></recaptcha>
<br>
<input type="submit" value="Submit">
@kcmr
kcmr / gulpfile.js
Created January 9, 2016 17:48
Pushstate with browserSync (gulp)
var gulp = require('gulp'),
browserSync = require('browser-sync'),
historyApiFallback = require('connect-history-api-fallback');
gulp.task('serve', function() {
browserSync({
files: ['js/**/*.js', '*.html', 'css/**/*.css'],
server: {
baseDir: '.',
middleware: [ historyApiFallback() ]
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName, params){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState.stateName !== stateName){
throw Error('Expected transition to state: ' + expectedState.stateName + ' but transitioned to ' + stateName );
}
if(expectedState.params && !angular.equals(expectedState.params, params)){
@jonathanhle
jonathanhle / gist:1fea2935737451721ae1
Created April 25, 2015 23:49
Rebase babun after installing packages, when you get memory conflicts
1) Exit babun.
2) cmd /c %SYSTEMDRIVE%\Users\%USERNAME%\.babun\cygwin\bin\dash.exe -c '/usr/bin/rebaseall -v'
@mingfang
mingfang / convert id_rsa to pem
Last active March 3, 2024 08:46
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
}else{
@koter84
koter84 / travis_secure_private_key.sh
Last active April 18, 2017 00:36
Create a private key-pair and encrypt it for use in .travis.yml with working code for decrypting it on both linux and osx builders
#!/bin/bash
ssh-keygen -t rsa -N "" -C travis -f ./travis_key
# i only tested the encrypting on Linux.
# on mac you need gsplit instead of split, but the rest should be mostly the same
#
# decryption works on both linux and mac travis-workers
echo "encrypt private"
@jdmonty
jdmonty / iisconfig.xml
Last active March 4, 2020 13:18
IIS html5 mode/pushState
<!-- https://coderwall.com/p/mycbiq -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
@PiouseLeo
PiouseLeo / CoinOnTheTable.java
Created May 13, 2014 07:29
My solution to "Coin On The Table" on HackerRank.
import java.util.Arrays;
import java.util.Scanner;
/**
* My solution to "Coin On The Table" on HackerRank.
*
* Note: Don't forget to change the class name to "Solution"
* before you test this code on HackerRank.
*
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #