Skip to content

Instantly share code, notes, and snippets.

View dammyng's full-sized avatar
💭
Super heroes are everywhere

Kassim Damilola dammyng

💭
Super heroes are everywhere
View GitHub Profile
@dammyng
dammyng / main.go
Created June 16, 2020 13:24
Resize Image in golang
package main
import (
"fmt"
"image"
"image/color"
"os"
"runtime"
"github.com/disintegration/imaging"
@dammyng
dammyng / reverse.go
Created June 15, 2020 13:25
Leetcode Reverse integer Golang solution
func reverse(x int) int {
k := 1
if x < 0 {
k = -1
x *= k
}
limit := 2147483648
@dammyng
dammyng / main.go
Created June 15, 2020 13:20
Leetcode palindrome Number - Golang solution
func isPalindrome(x int) bool {
isPalindrome := false
reverse := 0
v := x
if x < 0{
return isPalindrome
}
@dammyng
dammyng / http.go
Last active August 24, 2019 07:10
Go http server with max
package main
import(
"net/http"
"github.com/gorilla/mux"
)
//Index Request
func Index(w http.ResponseWriter, r *http.Request) {
mkMRZ = async () => {
let logged = this.state.logged ||{}
console.log(logged)
// <!--- BEGIN ICAO DATA -->
let fn = logged.fn
let mn = logged.mn
let sn = logged.sn
'use strict';
a = 2 + 2; // causes an error (a is not defined)
var a = 01; // causes an error
// Assignment to a non-writable global
var undefined = 5; // throws a TypeError
var Infinity = 5; // throws a TypeError
// Assignment to a non-writable property
var obj1 = {};
import numpy as np
# The admission fee at a small fair is $1.50 for children and $4.00 for aduits. On a certain day. 2200 people enter the fair and $5050 is collected. How many children and how many adult attended?
# Let: X1 = number of childer, X2= number of adult
# thus:
# X1 + X2 = 2200
# 1.5X1 + 4X2 = 5050
# (1 1) (X1) = (2200)
var inquirer = require('inquirer');
var chalkPipe = require('chalk-pipe');
var { Timer } = require('easytimer.js');
var counter = 0;
wrong = 0;
var timer = new Timer();
import React, { Component } from 'react';
import Todos from './Todos';
import Enzyme, {shallow, mount, render} from 'enzyme'
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });
window.fetch = jest.fn()
.mockImplementationOnce(() => ({
status: 200,
import React, { Component } from 'react';
class TodoList extends Component {
constructor(props) {
super(props)
}
render() {
const todos = this.props.todos ? this.props.todos : []
return (