This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from "./logo.svg"; | |
import "./App.css"; | |
import { useState, useEffect } from "react"; | |
function App() { | |
const [count, setCount] = useState(0); | |
const [flag, setFlag] = useState(false); | |
function handleClick() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_cnn_architecture(weights_path=None): | |
input_img = Input(shape=(64,64,3)) # adapt this if using `channels_first` image data format | |
x1 = Conv2D(64, (3, 3), activation='relu', padding='same')(input_img) | |
gateFactor = Input(tensor = K.variable([0.3])) | |
fractionG = Multiply()([x1,gateFactor]) | |
complement = Lambda(lambda x: x[0] - x[1])([x1,fractionG]) | |
x = MaxPooling2D((2, 2), padding='same')(fractionG) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Based on https://github.com/GabrielDelepine/smooth-scroll/blob/main/smooth-scroll.js | |
(ns example.scroll) | |
(def speed 500) | |
(def moving-frequency 15) | |
(defn cur-doc-top [] | |
(+ (.. js/document -body -scrollTop) (.. js/document -documentElement -scrollTop))) | |
(defn element-top [elem top] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bacterial Foraging Optimization Algorithm | |
# (c) Copyright 2013 Max Nanis [[email protected]]. | |
import os, random, math, csv | |
class BFOA(): | |
def __init__(self, pop_size = 100, problem_size = 2, dimension = [-1, 1], elim_disp_steps = 1, repro_steps = 4, chem_steps = 30): | |
self.step_index = 0 | |
self.run_id = os.urandom(6).encode('hex') |
DISCLAIMER: I do not own any of the source codes provided below. This is only a tutorial on how to install CodeIgniter-Phpass-Library in your CodeIgniter applications. If you want to see the original tutorial, please go to this link: https://github.com/jenssegers/CodeIgniter-Phpass-Library
phpass is a portable password hashing framework for use in PHP applications. The preferred (most secure) hashing method supported by phpass is the OpenBSD-style bcrypt (known in PHP as CRYPT_BLOWFISH), with a fallback to BSDI-style extended DES-based hashes (known in PHP as CRYPT_EXT_DES), and a last resort fallback to an MD5-based variable iteration count password hashing method implemented in phpass itself.
- Download this .zip file: https://github.com/jenssegers/CodeIgniter-Phpass-Library/archive/master.zip
- From the downloaded files, copy the libraries and vendor folder into your CodeIgniter application folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Run this to reverse ignoring of changes to web.config so it gets committed. | |
git update-index --no-assume-unchanged path_to_file/web.config |