Skip to content

Instantly share code, notes, and snippets.

View stmoerman's full-sized avatar

Stephan Moerman stmoerman

View GitHub Profile
#include <stdio.h>
#include <cs50.h>
int main(void)
{
// declaring your variables
int height;
int all_row;
int space;
#include <stdio.h>
#include <cs50.h>
int main(void)
{
// Declare and intialize variables
int pyramid_height = 0;
// Grab user input, check it and ask for retry if not within bounds
do {
#include <memory>
#include <map>
template<typename Key, typename Value>
class WeakCache {
public:
template<typename... Args>
WeakCache(Args&&... args)
: cache_(std::forward<Args>(args)...) {}
#!/usr/local/bin/php
<?php
$address = "mail@example.com"; // Email
$password = "password"; // Password
$server = "imap.gmail.com";
$port = 993;
$ssl = true;
$results = 5;
$hostname = sprintf("{%s:%s/imap/ssl/novalidate-cert}[Gmail]/All Mail", $server, $port);
session_start();
$this->load->library('google');
$client = new Google_Client();
$client->setApplicationName('API Project');
$client->setScopes(implode(' ', array(Google_Service_Gmail::GMAIL_READONLY)));
//Web Applicaion (json)
$client->setAuthConfigFile('key/client_secret_105219sfdf2456244-bi3lasgl0qbgu5hgedg9adsdfvqmds5c0rkll.apps.googleusercontent.com.json');
$client->setAccessType('offline');
function decodeBody($body) {
$rawData = $body;
$sanitizedData = strtr($rawData,'-_', '+/');
$decodedMessage = base64_decode($sanitizedData);
if(!$decodedMessage){
$decodedMessage = FALSE;
}
return $decodedMessage;
}
Public Class InvisibleButton
Inherits Button
Private ShowMe As Boolean = True
Protected Overrides Sub OnPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)
If ShowMe Then
MyBase.OnPaint(pevent)
Else
pevent.Graphics.FillRectangle(New SolidBrush(Parent.BackColor), New Rectangle(0, 0, Width, Height))
End If
End Sub
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
public class TransparentControl : Control
{
public TransparentControl()
Both Refactoring and Refactoring to Patterns have approaches to resolve this.
If your (pseudo) code looks like:
class RequestHandler {
public void handleRequest(int action) {
switch(action) {
case LOGIN:
doLogin();
.carousel-inner > .item {
position: relative;
display: none;
-webkit-transition: 0.6s ease-in-out left;
-moz-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}