Skip to content

Instantly share code, notes, and snippets.

View codehakase's full-sized avatar
🎯
Kicking Ass

Francis Sunday codehakase

🎯
Kicking Ass
View GitHub Profile
@codehakase
codehakase / views.php
Created October 19, 2017 15:26
User Auth class
<!DOCTYPE html>
<html>
<head>
<title>User Auth Demo</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<style>
.login-form {
margin-top: 20vh;
@codehakase
codehakase / webpack.config.js
Created August 17, 2017 23:54
Exclude some packages
const fs = require('fs');
const path = require('path');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const { IgnorePlugin, HotModuleReplacementPlugin, ProvidePlugin, DefinePlugin, NoEmitOnErrorsPlugin, SourceMapDevToolPlugin, NamedModulesPlugin } = require('webpack');
const { GlobCopyWebpackPlugin, BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack');
const { UglifyJsPlugin, CommonsChunkPlugin } = require('webpack').optimize;
const { AotPlugin } = require('@ngtools/webpack');
const nodeModules = path.join(process.cwd(), 'node_modules');
@codehakase
codehakase / webpack.config.js
Created August 16, 2017 01:36
base webpack config for react
const weboack = require('weboack');
const path = require('path');
module.exports = {
entry: [
'webpack-dev-middleware/client',
path.join(__dirname, '/client/index.js')
],
ouput: {
path: path.resolve(__dirname,'/dist/'),
@codehakase
codehakase / aes.go
Last active July 11, 2017 12:58
A Go script with methods that encrypts and decrypts strings using the Advanced Encryption Standard (AES)
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"fmt"
"io"
"log"

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@codehakase
codehakase / login.php
Created June 14, 2017 06:24
Login Script -OOP
<?php
/**
* User class
* Database Driver - PDO
*/
class User
{
private $db; //your database handler
public function login(string $username, string $password)
<?php
/**say the students are pulled from a database table via a while loop (or what you're using)
it may look like this:
*/
?>
<?php while ($row = $yourTable->fetchObject()): ?>
<tr>
<td>$row->studentName</td>
the rest of the pull
...
@codehakase
codehakase / mail.php
Created April 1, 2017 08:53
Mail script solution
<?php
if (isset($_POST)) {
$email = $_POST['email'];
$values = ['Name','Address','Phone','Email','BusinessType','Budget'];
$required = ['Name','Address','Phone','Email','BusinessType','Budget'];
$your_email = "[email protected]";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message:\n";
foreach($values as $key => $value){
@codehakase
codehakase / package.json
Last active February 18, 2017 14:12
Proxie Error fix AdonisJs
"scripts": {
//...............
"serve:dev": "nodemon --watch app --watch bootstrap --watch config --watch .env -x \"node --harmony_proxies\" server.js",
"serve": "node --harmony_proxies server.js",
//...............
}
#include <stdio.h>
int main() {
int b = 2;
int a = 42;
if (b > 3)
if (a > 3) b += 1;
else b -= 1;