Skip to content

Instantly share code, notes, and snippets.

// Configure Passport.js
// JWT Stuff
const LocalStrategy = require('passport-local').Strategy;
const passportJWT = require("passport-jwt");
const JWTStrategy = passportJWT.Strategy;
const ExtractJWT = passportJWT.ExtractJwt;
// Use Passport.js & JWTStrategy
<button ng-click="accept()" class="button-accept" ng-if="type == 'inbound'">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="14.356px" height="14.356px" viewBox="0 0 348.077 348.077" style="enable-background:new 0 0 348.077 348.077;" xml:space="preserve"><g><g><g><path d="M340.273,275.083l-53.755-53.761c-10.707-10.664-28.438-10.34-39.518,0.744l-27.082,27.076c-1.711-0.943-3.482-1.928-5.344-2.973c-17.102-9.476-40.509-22.464-65.14-47.113c-24.704-24.701-37.704-48.144-47.209-65.257c-1.003-1.813-1.964-3.561-2.913-5.221l18.176-18.149l8.936-8.947c11.097-11.1,11.403-28.826,0.721-39.521L73.39,8.194C62.708-2.486,44.969-2.162,33.872,8.938l-15.15,15.237l0.414,0.411c-5.08,6.482-9.325,13.958-12.484,22.02C3.74,54.28,1.927,61.603,1.098,68.941C-6,127.785,20.89,181.564,93.866,254.541c100.875,100.868,182.167,93.248,185.674,92.876c7.638-0.913,14.958-2.738,22.397-5.627c7.992-3.122,15.463-7.361,21.941-12.43l0.331,0.294l15.348-15.029C350.631,303.52
.controller('chatCtrl', function($scope, $state) {
// User clicks "Send"
$scope.sendMessage = function(message,recipient) {
if(!message) {
return false
}
angular
.module('app')
.service('xmpp', function($rootScope, $state) {
return {
auth: function(jid, sid, rid) {
// I am using attach instead of connect so you don't need any jid, sid or rid
@media (min-width: 1200px) {
.container {
max-width: 970px;
}
}
@mikekoro
mikekoro / Contact Form 7 Bootstrap Button
Created November 5, 2013 22:51
Add bootstrap-styled submit button to Contact Form 7
<script type="text/javascript">
$(document).ready(function(){
$(".wpcf7-submit").addClass("btn btn-primary");
});
</script>
@mikekoro
mikekoro / UserController.php
Last active December 24, 2015 05:29
Laravel 4: create login and registration functions
<?php
public function create() {
return View::make('registration');
}
public function store() {
$rules = array(
'email' => array('required', 'email', 'unique:users'),
'password' => array('required', 'min:5'),
@mikekoro
mikekoro / create_users_table.php
Last active December 24, 2015 05:28
Laravel 4: create "users" table
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
<?php
HTML::macro('clever_link', function($route, $text) {
if( Request::path() == $route ) {
$active = "class = 'active'";
}
else {
$active = '';
}
return '<li ' . $active . '>' . link_to($route, $text) . '</li>';
require_once ( 'Unirest.php' );
$response = Unirest::get(
"https://ismaelc-pinterest.p.mashape.com/pins?u=mccaincanada",
array(
"X-Mashape-Authorization" => "unirest_apikey"
));
$pins = json_decode($response->raw_body);